Re: [sqlite] Index usage when using UNION

2011-12-16 Thread Simon Slavin
On 16 Dec 2011, at 2:20am, Igor Tandetnik wrote: > Simon Slavin wrote: >> On 15 Dec 2011, at 7:19pm, Alexandr Němec wrote: >> >>> [UNION] >> >> Your 'ORDER BY' clause applies only to the second SELECT. > > Not true. Yeah, so I noticed from Richard's post. Sorry

Re: [sqlite] Index usage when using UNION

2011-12-15 Thread Igor Tandetnik
Simon Slavin wrote: > On 15 Dec 2011, at 7:19pm, Alexandr Němec wrote: > >> just a quick question, I did not find the answer in the various technical >> documents. I have two identical tables with a id >> INTEGER as a primary key, which means that SELECTions ORDERed BY id

Re: [sqlite] Index usage when using UNION

2011-12-15 Thread Richard Hipp
2011/12/15 Alexandr Němec > > Dear all, > > just a quick question, I did not find the answer in the various technical > documents. I have two identical tables with a id INTEGER as a primary key, > which means that SELECTions ORDERed BY id are very fast. Now if I do SELECT > *

Re: [sqlite] Index usage when using UNION

2011-12-15 Thread Simon Slavin
On 15 Dec 2011, at 7:19pm, Alexandr Němec wrote: > just a quick question, I did not find the answer in the various technical > documents. I have two identical tables with a id INTEGER as a primary key, > which means that SELECTions ORDERed BY id are very fast. Now if I do SELECT * > FROM

[sqlite] Index usage when using UNION

2011-12-15 Thread Alexandr Němec
Dear all,   just a quick question, I did not find the answer in the various technical documents. I have two identical tables with a id INTEGER as a primary key, which means that SELECTions ORDERed BY id are very fast. Now if I do SELECT * FROM table1 UNION ALL SELECT * FROM table2 ORDER by id,