Re: [sqlite] Multi-column index is not used with IN operator

2013-01-17 Thread Selen Schabenberger
to speed up this query or you think it is a bug in the optimizer?  - Selen From: Selen Schabenberger selen_oz...@yahoo.com To: General Discussion of SQLite Database sqlite-users@sqlite.org; Dan Kennedy danielk1...@gmail.com Sent: Wednesday, January 16, 2013

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-17 Thread Selen Schabenberger
with IN operator On 01/17/2013 06:32 PM, Selen Schabenberger wrote: Dan, I have just realised that with the sqlite_stat3 table, the query optimizer uses the INDEX IDX_TAG. When I drop this table, the PK is used as you said. But the concatenated index is still not used with the stat3. Looks like

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-16 Thread Selen Schabenberger
 SUBQUERY 1    Hope someone can help. - Selen From: Selen Schabenberger selen_oz...@yahoo.com To: General Discussion of SQLite Database sqlite-users@sqlite.org; Richard Hipp d...@sqlite.org Sent: Wednesday, January 2, 2013 12:22 PM Subject: Re: [sqlite

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-16 Thread Selen Schabenberger
@sqlite.org Sent: Wednesday, January 16, 2013 12:05 PM Subject: Re: [sqlite] Multi-column index is not used with IN operator On 01/16/2013 05:13 PM, Selen Schabenberger wrote: I attach a small database where it is possible to reproduce the issue. I deleted all irrelevant tables and all the tuples

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-16 Thread Selen Schabenberger
@sqlite.org Sent: Wednesday, January 16, 2013 1:12 PM Subject: Re: [sqlite] Multi-column index is not used with IN operator On 01/16/2013 06:25 PM, Selen Schabenberger wrote: Below is the output of the dump. If it does not help reproduce the error, then I can try to share the original database

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-16 Thread Selen Schabenberger
Sent: Wednesday, January 16, 2013 1:12 PM Subject: Re: [sqlite] Multi-column index is not used with IN operator On 01/16/2013 06:25 PM, Selen Schabenberger wrote: Below is the output of the dump. If it does not help reproduce the error, then I can try to share the original database file

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-16 Thread Selen Schabenberger
, 2013 2:56 PM Subject: Re: [sqlite] Multi-column index is not used with IN operator On 01/16/2013 08:48 PM, Selen Schabenberger wrote: However, in 3.7.16, the penalty for the external sort is (3*nRow*log10(nRow)) and there is no discount for using a covering index (instead, there would be another

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-16 Thread Selen Schabenberger
: Dan Kennedy danielk1...@gmail.com To: sqlite-users@sqlite.org Sent: Wednesday, January 16, 2013 3:14 PM Subject: Re: [sqlite] Multi-column index is not used with IN operator On 01/16/2013 09:04 PM, Selen Schabenberger wrote: The entry for the Tag index in sqlite_stat1: 460132 1289

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-16 Thread Selen Schabenberger
of SQLite Database sqlite-users@sqlite.org Sent: Wednesday, January 16, 2013 3:40 PM Subject: Re: [sqlite] Multi-column index is not used with IN operator On 01/16/2013 09:22 PM, Selen Schabenberger wrote: PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE 'Message' ('Id' INTEGER PRIMARY KEY

[sqlite] Query planning with concatened vs single index

2013-01-14 Thread Selen Schabenberger
Hi, Having an index on 3 integer columns (column1, column2, column3), the analyse command generates the stat1 and stat3 tables. I see the following statistics for this index in the sqlite_stat1 table: 4600132 1289 1275 1 When I execute the following SQL query, this index is not used but the

Re: [sqlite] Query planning with concatened vs single index

2013-01-14 Thread Selen Schabenberger
The results I wrote was after executing the ANALYZE.  But If I drop the stat1 and stat3 tables, the query is faster and I see in the output of the explain query plan that my index is used. Selen From: Simon Slavin slav...@bigfraud.org To: Selen Schabenberger

Re: [sqlite] Query planning with concatened vs single index

2013-01-14 Thread Selen Schabenberger
By the way I am using the SQLite version 3.7.15.2. I do not see the same behaviour with the version 3.6. Selen From: Selen Schabenberger selen_oz...@yahoo.com To: Simon Slavin slav...@bigfraud.org; General Discussion of SQLite Database sqlite-users

Re: [sqlite] Multi-column index is not used with IN operator

2013-01-02 Thread Selen Schabenberger
would really appreciate any suggestions. Happy new year! Regards,Selen --- On Fri, 12/14/12, Richard Hipp d...@sqlite.org wrote: From: Richard Hipp d...@sqlite.org Subject: Re: [sqlite] Multi-column index is not used with IN operator To: Selen Schabenberger selen_oz...@yahoo.com, General Discussion

[sqlite] Multi-column index is not used with IN operator

2012-12-14 Thread Selen Schabenberger
Hi All, I am observing some strange behaviour on my database when I execute a query with an IN operator having more than 22 expressions. My table structure looks basically as follows: CREATE TABLE Messages (Id INTEGER PRIMARY KEY NOT NULL, Tag INTEGER NOT NULL, Flag INTEGER ) I have a

Re: [sqlite] Multi-column index is not used with IN operator

2012-12-14 Thread Selen Schabenberger
chooses the primary key on the Id column. -Selen From: Richard Hipp d...@sqlite.org To: Selen Schabenberger selen_oz...@yahoo.com; General Discussion of SQLite Database sqlite-users@sqlite.org  Sent: Friday, December 14, 2012 3:09 PM Subject: Re: [sqlite] Multi-column index is not used

Re: [sqlite] Multi-column index is not used with IN operator

2012-12-14 Thread Selen Schabenberger
From: Hick Gunter h...@scigames.at To: 'Selen Schabenberger' selen_oz...@yahoo.com; 'General Discussion of SQLite Database' sqlite-users@sqlite.org Sent: Friday, December 14, 2012 3:26 PM Subject: AW: [sqlite] Multi-column index is not used with IN operator From what I understand