Re: [sqlite] Curious query plan selection

2012-04-16 Thread Richard Hipp
On Mon, Apr 16, 2012 at 10:31 AM, George wrote: > On 4/16/12, Richard Hipp wrote: > > On Mon, Apr 16, 2012 at 9:43 AM, George wrote: > > > >> > >> create table if not exists SnapshotsMarketsRunners( > >>ID integer primary

Re: [sqlite] Curious query plan selection

2012-04-16 Thread George
On 4/16/12, Richard Hipp wrote: > On Mon, Apr 16, 2012 at 9:43 AM, George wrote: > >> >> create table if not exists SnapshotsMarketsRunners( >>ID integer primary key, >>SnapshotsID integer not null references Snapshots(ID), >>

Re: [sqlite] Curious query plan selection

2012-04-16 Thread Richard Hipp
On Mon, Apr 16, 2012 at 9:43 AM, George wrote: > > create table if not exists SnapshotsMarketsRunners( >ID integer primary key, >SnapshotsID integer not null references Snapshots(ID), >MarketsRunnersID not null references MarketsRunners(ID), >

Re: [sqlite] Curious query plan selection

2012-04-16 Thread George
On 4/16/12, Richard Hipp wrote: > Hard to say why, without knowing your schema. Here is the schema: create table if not exists Errors( ID integer primary key, Timestamp text not null, ErrorCode text, Name text, RequestName text,

Re: [sqlite] Curious query plan selection

2012-04-16 Thread Richard Hipp
On Sun, Apr 15, 2012 at 2:31 PM, George wrote: > Compare the following two queries and their query plans: > > 1) explain query plan select * from snapshotsmarketsrunners where marketsru > nnersid in (1); > > 0|0|0|SEARCH TABLE snapshotsmarketsrunners USING INDEX >

[sqlite] Curious query plan selection

2012-04-15 Thread George
Compare the following two queries and their query plans: 1) explain query plan select * from snapshotsmarketsrunners where marketsru nnersid in (1); 0|0|0|SEARCH TABLE snapshotsmarketsrunners USING INDEX SnapshotsMarketsRunnersMa rketsRunnersIDSnapshotsID (MarketsRunnersID=?) (~10 rows)