> This is the example I tried to explain: > > I have a table that store the status of some tickets. You always know how many status there can be. > If you said: > > 1-Open > 2-Close > 3-Invalid > > Then if you want to show the history, you will ask for LIMIT 3, but the database will try to find > the 4th row after finding the only 3 that can exist. > > This is why I told this is a performance issue. Not an error.
I sure hope you've normalized your database so that "status" is stored in a separate table from the rest of the history? If so, you should have a proper primary key in the history table that you can index on and the search will stop after looking at 4 records; the three that match and first one that doesn't match (at which point it will know the search is done.) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]