Re: [sqlite] EXT : speeding up FTS4

2011-09-28 Thread Simon Slavin
On 28 Sep 2011, at 3:52pm, Petite Abeille wrote: > On Sep 28, 2011, at 4:48 PM, Puneet Kishor wrote: > >> But, if I understood [http://www.sqlite.org/datatype3.html] correctly, there >> really is no such thing as DATETIME value. Internally, it is stored as TEXT >> anyway. > > Or as a number.

Re: [sqlite] EXT : speeding up FTS4

2011-09-28 Thread Simon Slavin
On 28 Sep 2011, at 3:48pm, Puneet Kishor wrote: > Could I? Sure, if I had known better. Should I? I would be happy to create a > new column, convert the values to julian days, and try that, but on a 27 GB > db, that would take a bit of a while. You only have to do it once, you can do it

Re: [sqlite] EXT : speeding up FTS4

2011-09-28 Thread Petite Abeille
On Sep 28, 2011, at 4:48 PM, Puneet Kishor wrote: > But, if I understood [http://www.sqlite.org/datatype3.html] correctly, there > really is no such thing as DATETIME value. Internally, it is stored as TEXT > anyway. Or as a number. Your choice: • TEXT as ISO8601 strings ("-MM-DD

Re: [sqlite] EXT : speeding up FTS4

2011-09-28 Thread Puneet Kishor
On Sep 28, 2011, at 9:44 AM, Simon Slavin wrote: > > On 28 Sep 2011, at 3:41pm, Puneet Kishor wrote: > >> WHERE Datetime(u.downloaded_on) >= Datetime(p.project_start) > > Why are you doing 'Datetime' here ? Not only does the conversion take time, > but it means you can't usefully index

Re: [sqlite] EXT : speeding up FTS4

2011-09-28 Thread Simon Slavin
On 28 Sep 2011, at 3:41pm, Puneet Kishor wrote: >WHERE Datetime(u.downloaded_on) >= Datetime(p.project_start) Why are you doing 'Datetime' here ? Not only does the conversion take time, but it means you can't usefully index either of those two columns. Can you instead store your stamps

Re: [sqlite] EXT : speeding up FTS4

2011-09-28 Thread Puneet Kishor
On Sep 28, 2011, at 8:02 AM, Black, Michael (IS) wrote: > Have you done "ANALYZE"? That might help. > > Also...try to arrange your joins based on record count (both high-to-low and > low-to-high) and see what difference it makes. > > Since you have only one WHERE clause I'm guessing having

Re: [sqlite] EXT : speeding up FTS4

2011-09-28 Thread Black, Michael (IS)
Have you done "ANALYZE"? That might help. Also...try to arrange your joins based on record count (both high-to-low and low-to-high) and see what difference it makes. Since you have only one WHERE clause I'm guessing having project_ids as the first join makes sense. Michael D. Black Senior