in reply to Ranking position in a SQL index
Don't forget the LIMIT part. It makes the search more efficient. Note also that idn should be a primary key auto-increment, so it returns the row number assuming you don't delete any rows (better to flag rows for delete and then replace with fresh data later on).
On the other hand, if you're just doing this from a text file, you can set up a secondary file with all the index values and line numbers in order by index, and then perform a binary search to find the line number you want. Then the line number can be used to access the actual data in the other file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Ranking position in a SQL index
by demerphq (Chancellor) on Oct 05, 2004 at 17:29 UTC | |
by dragonchild (Archbishop) on Oct 05, 2004 at 17:36 UTC | |
by demerphq (Chancellor) on Oct 05, 2004 at 17:42 UTC | |
by mpeppler (Vicar) on Oct 05, 2004 at 19:35 UTC |