Re: [sqlite] An Explain Query Plan that I cannot explain

2014-07-18 Thread Staffan Tylen
Thanks for the tip, ANALYZE is the cause. Without it the index will be searched. Staffan On Thu, Jul 17, 2014 at 7:38 PM, Simon Slavin wrote: > > On 17 Jul 2014, at 6:34pm, Staffan Tylen wrote: > > > I'm unable to understand why T2 isn't using

Re: [sqlite] An Explain Query Plan that I cannot explain

2014-07-17 Thread Simon Slavin
On 17 Jul 2014, at 6:34pm, Staffan Tylen wrote: > I'm unable to understand why T2 isn't using the index. Is it the fact that > the table T2 only has 2 rows so SQLite has decided that it's quicker with a > scan? Does doing an ANALYZE change anything ? Simon.

[sqlite] An Explain Query Plan that I cannot explain

2014-07-17 Thread Staffan Tylen
I've got a view VJU covering 8 tables T1-T8. They all share a column C1 which is indexed in each table: CREATE VIEW VJU AS SELECT * FROM T1 LEFT JOIN T2 USING (C1) LEFT JOIN T3 USING (C1) LEFT JOIN T4 USING (C1) LEFT JOIN T5 USING (C1) LEFT JOIN T6 USING (C1) LEFT JOIN T7 USING (C1) LEFT JOIN T8