TheHiveMind
Banned
- Joined
- Jul 25, 2008
- Messages
- 5,073
I am looking for a single record in a big table. It is indexed on rather useless columns.
"Oder by" is slower than just going through all of them. What I want it to do is to select the records the way it does when I don't specify any order, except, I want it in reverse. It mustn't order anything after selection, it must pick them up that way. I am trying to get it to search the newest records first so that it can break out of the query as soon as it retrieves a result. Surely something like this is possible, it's an efficient solution to an annoying little problem.
Something like: ReverseSelect xyz from Table1 where abc = 'blahblah' limit 1;
"Oder by" is slower than just going through all of them. What I want it to do is to select the records the way it does when I don't specify any order, except, I want it in reverse. It mustn't order anything after selection, it must pick them up that way. I am trying to get it to search the newest records first so that it can break out of the query as soon as it retrieves a result. Surely something like this is possible, it's an efficient solution to an annoying little problem.
Something like: ReverseSelect xyz from Table1 where abc = 'blahblah' limit 1;