Mikey C <spam.bucket-XZoyATsUNX5Wk0Htik3J/[EMAIL PROTECTED]> wrote:
I don't think you really understand what I'm trying to say.

Web based systems require paging that does not iterate through all
records.

I understand perfectly what you want. All I'm saying is there are solid technical reasons why SQLite (and really any other SQL engine) cannot deliver.

Finding out how many records there are in the recordset is precisely as computationally intensive as running select count(*) query, which you can as well do yourself. Presumably, you want to apply LIMIT clause to speed up execution, but if you at the same time require that the query know the exact number of rows in a full resultset (in a hypothetical SQL engine that supports such a feature), you would lose all benefits of LIMIT because the engine would have to enumerate all records anyway.

LIMIT gives this great power (ie. I only want to read 10 record
starting from record 151)

By the way, for most queries you will find that the execution time grows as the OFFSET grows. To implement OFFSET X, the engine would enumerate records from the beginning and simply ignore the first X-1. Retrieving the last pageful often takes almost as long as retrieving all the records.

I'd rather SQLite reads on 10 records and not 100 million records into
memory, just to discard them all except the 10 the user needs for
that page of results?

But if it does not look at all the records, how precisely do you propose it should know how many there are? Built-in crystal ball?

Igor Tandetnik

Reply via email to