Re: [sqlite] LIMIT versus sqlite3_step LIMIT times

2018-02-16 Thread Cezary H. Noweta
Hello, On 2018-02-16 13:00, Dominique Devienne wrote: While you're technically right, I think of SQL as a declarative language, and as such I'd say giving this information to SQLite is a best practice IMHO. Unlikely in this case, but perhaps one day SQLite might be able to optimize "something"

Re: [sqlite] LIMIT versus sqlite3_step LIMIT times

2018-02-16 Thread x
I suppose ‘select * from (original select with limit clause) limit :lim’ gets round it. From: Dominique Devienne<mailto:ddevie...@gmail.com> Sent: 16 February 2018 12:21 To: SQLite mailing list<mailto:sqlite-users@mailinglists.sqlite.org> Subject: Re: [sqlite] LIMIT versus sqlite

Re: [sqlite] LIMIT versus sqlite3_step LIMIT times

2018-02-16 Thread Dominique Devienne
On Fri, Feb 16, 2018 at 1:11 PM, x wrote: > Thanks for the replies. For my purpose it was about avoiding the > possibility of having to apply a limit to a query that might already have a > limit clause. Good point. I tried, and indeed that's an issue. I really really

Re: [sqlite] LIMIT versus sqlite3_step LIMIT times

2018-02-16 Thread x
ite-users@mailinglists.sqlite.org> Subject: Re: [sqlite] LIMIT versus sqlite3_step LIMIT times On Fri, Feb 16, 2018 at 12:33 PM, Cezary H. Noweta <c...@poczta.onet.pl> wrote: > On 2018-02-16 11:18, x wrote: > >> If a query is sorted on an index is there any advantage to including &

Re: [sqlite] LIMIT versus sqlite3_step LIMIT times

2018-02-16 Thread Dominique Devienne
On Fri, Feb 16, 2018 at 12:33 PM, Cezary H. Noweta wrote: > 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 --

Re: [sqlite] LIMIT versus sqlite3_step LIMIT times

2018-02-16 Thread Cezary H. Noweta
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

[sqlite] LIMIT versus sqlite3_step LIMIT times

2018-02-16 Thread x
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? ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org