Hello,

On 2018-02-16 11:18, x wrote:
If a query is sorted on an index is there any advantage to including LIMIT in 
the stmt as opposed to omitting it and stepping through the result set LIMIT 
times?

No -- LIMIT appends an additional opcode to check the number of rows and introduces an effort related to an additional parsing. In general, LIMIT can reduce a cost of a full external sorting, however this does not apply to your query.

BTW, in file ``src/select.c'' line 2377:

Expr *pLimit;    /* Saved values of p->nLimit  */

should be

Expr *pLimit;    /* Saved values of p->pLimit  */

-- best regards

Cezary H. Noweta
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to