Re: [sqlite] Statistics on integer primary key - Cardinality

2010-08-02 Thread Griggs, Donald
Hi Peter, Regarding: "Selectivity is known -- since it's a primary key, which is unique -- it will be 1. Cardinality can vary." I wonder if you're referring to the definition of *cardinality* as used in mathematics http://en.wikipedia.org/wiki/Cardinality In mathematics, t

Re: [sqlite] Statistics on integer primary key

2010-07-30 Thread Peter.Hizalev
users@sqlite.org Subject: Re: [sqlite] Statistics on integer primary key On Thu, 29 Jul 2010 17:25:50 PDT, wrote: >Hello, > >Consider two tables: > >> create table a(num integer primary key); >> create table b(num integer primary key); > >After loading both tables

Re: [sqlite] Statistics on integer primary key

2010-07-30 Thread Richard Hipp
On Fri, Jul 30, 2010 at 4:39 PM, Cory Nelson wrote: > On Thu, Jul 29, 2010 at 5:25 PM, wrote: > > Hello, > > > > Consider two tables: > > > >> create table a(num integer primary key); > >> create table b(num integer primary key); > > > > After loading both tables we have 100 rows in table a

Re: [sqlite] Statistics on integer primary key

2010-07-30 Thread Cory Nelson
On Thu, Jul 29, 2010 at 5:25 PM, wrote: > Hello, > > Consider two tables: > >> create table a(num integer primary key); >> create table b(num integer primary key); > > After loading both tables we have 100 rows in table a and 1000 in table > b. We make sure b.num is a subset of a.num. Now we

Re: [sqlite] Statistics on integer primary key

2010-07-30 Thread Kees Nuyt
On Thu, 29 Jul 2010 17:25:50 PDT, wrote: >Hello, > >Consider two tables: > >> create table a(num integer primary key); >> create table b(num integer primary key); > >After loading both tables we have 100 rows in table a and 1000 in table b. >We make sure b.num is a subset of a.num. Now we ex

[sqlite] Statistics on integer primary key

2010-07-29 Thread Peter.Hizalev
Hello, Consider two tables: > create table a(num integer primary key); > create table b(num integer primary key); After loading both tables we have 100 rows in table a and 1000 in table b. We make sure b.num is a subset of a.num. Now we execute: > analyze We run two queries with timer on: