[sqlite] Performance issue with CTE

2015-10-05 Thread Philippe Riand
Just to let you know, the solution using SELECT * FROM (query with offset/limit) works perfectly well. Thanks a lot for the suggestion!

[sqlite] Performance issue with CTE

2015-10-02 Thread Philippe Riand
I think the doc is right. I overcame the problem by using a construct like: SELECT field1, field2? WHERE PKEY IN (SELECT PKEY ? WHERE OFFSET n LIMIT m) That executes a sub query. But your solution looks actually better, as it is: SELECT * FROM (SELECT field1, field2? WHERE OFFSET n LIMIT m)

[sqlite] Performance issue with CTE

2015-10-02 Thread Philippe Riand
Thanks. I know about the technique your mentioned, but the point is not about the use of offset or not. The same issue will happen but using a key. See my other reply above.

[sqlite] Performance issue with CTE

2015-10-01 Thread Kees Nuyt
On Thu, 1 Oct 2015 13:40:23 +0200, Clemens Ladisch wrote: > OFFSET is inefficient because the database still has to compute all the > rows before skipping over them. > > To do paging, remember the first and last date values on the page, and > for the previous/next page, just continue from there:

[sqlite] Performance issue with CTE

2015-10-01 Thread Clemens Ladisch
Philippe Riand wrote: > I have a table with 500,000+ records. The table has a date column, > that I?m using to sort my queries (the columns has an index). Simple > queries on the table work very well, using ORDER BY, LIMIT & OFFSET. > I?m actually extracting ?pages? of rows that I?m displaying in

[sqlite] Performance issue with CTE

2015-10-01 Thread E.Pasma
Op 1 okt 2015, om 04:10 heeft Philippe Riand wrote: > I have a table with 500,000+ records. The table has a date column, > that I?m using to sort my queries (the columns has an index). Simple > queries on the table work very well, using ORDER BY, LIMIT & OFFSET. > I?m actually extracting

[sqlite] Performance issue with CTE

2015-09-30 Thread Philippe Riand
I have a table with 500,000+ records. The table has a date column, that I?m using to sort my queries (the columns has an index). Simple queries on the table work very well, using ORDER BY, LIMIT & OFFSET. I?m actually extracting ?pages? of rows that I?m displaying in a web page. Great!. Now,