Re: [sqlite] change ORDER BY slowly

2017-03-27 Thread Keith Medcalf
If you really want to filter as you have specified, then it will take a while. This is because the entire query must be performed (up to the point you are applying the order), then sorted, then the top rows selected to match you limit, then any remaining outer joins performed. Or you can

Re: [sqlite] change ORDER BY slowly

2017-03-27 Thread Keith Medcalf
move the join to immediately follow the FROM clause remove the word "left" > -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] > On Behalf Of MONSTRUO Hugo González > Sent: Monday, 27 March, 2017 09:35 > To: sqlite-users@mailinglists.sqlite.org

Re: [sqlite] change ORDER BY slowly

2017-03-27 Thread David Raymond
The main issue there I believe is that the order by/limit for the first two is on the outermost table, so it can order by/limit that right away. In the last query the order by/limit is on a table in the middle, so it can't order or filter on it right away, and needs the temp tree there. I saw

Re: [sqlite] change ORDER BY slowly

2017-03-27 Thread Simon Slavin
On 27 Mar 2017, at 4:35pm, MONSTRUO Hugo González wrote: > nbmCodigo VARCHAR (6) VARCHAR 6 I wanted to note that SQLite completely ignores VARCHAR and any size limits. As far as SQLite is concerned, all those fields are TEXT fields and can contain any number of