On 8/18/07, Mina R Waheeb <[EMAIL PROTECTED]> wrote: > Hi, > Thanks for reply. I'm still confused about that. I don't know much > about SQLite internals, But what i understanded from your reply that > SQLite fetch any row match the query condation and then apply to it > the GROUP BY then apply to it the ORDER BY is there is any, And when > the LIMIT appears SQLite keep fetching the result from the "start" > until the result set size equals the requested limit. > > Do you mean the LIMIT in SQLite is not optimized? and the performance > of selecting from table contains 1000 rows match the query condation > equal selecting the same condation with limit 990,10?
Yes. The limit clause just skips the number of records you want from the result set. I haven't checked the code, but I believe you still gain something because you can also avoid reading full rows if you don't need to (like having an index - or an autogenerated temporary index - you can use) when sqlite does the initial "skip" part. Regards, ~Nuno Lucas > > Thanks, > Mina. ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------