Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Database Query Search

Name: Anonymous 2011-10-09 1:14

Hello, I would highly appreciate some help with this

Consider this query:
Select * from Employee where salary>10000 sort by salary desc;

How is it actually implemented by the database? If the records are all stored in some sort of a binary search tree, sorted by their index (say the primary key), it's going to be incredibly hard to search and sort the results by salary.

Name: Anonymous 2011-10-09 9:04

>>5
Either you don't have an index, in which case you're doing a butt-slow scan of the whole table, or you have, in which case you're already getting the results in sorted order.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List