Re: [sqlite] Index on BOOLEAN field

2011-09-14 Thread François
Thank you all On 13 sep, 22:24, "Jay A. Kreibich" wrote: > On Tue, Sep 13, 2011 at 09:16:32PM +0100, Simon Slavin scratched on the wall: > > > > > On 13 Sep 2011, at 7:22pm, Petite Abeille wrote: > > > > On Sep 13, 2011, at 2:15 PM, Simon Slavin wrote: > > > >> It's about chunkiness, and which

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Jay A. Kreibich
On Tue, Sep 13, 2011 at 09:16:32PM +0100, Simon Slavin scratched on the wall: > > On 13 Sep 2011, at 7:22pm, Petite Abeille wrote: > > > On Sep 13, 2011, at 2:15 PM, Simon Slavin wrote: > > > >> It's about chunkiness, and which of the values you're looking for. > > > > Chunkiness? Surely you me

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Simon Slavin
On 13 Sep 2011, at 7:22pm, Petite Abeille wrote: > On Sep 13, 2011, at 2:15 PM, Simon Slavin wrote: > >> It's about chunkiness, and which of the values you're looking for. > > Chunkiness? Surely you mean selectivity, no? I'm sorry, but I've failed to find a better word. You can have a table w

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Petite Abeille
On Sep 13, 2011, at 2:15 PM, Simon Slavin wrote: > It's about chunkiness, and which of the values you're looking for. Chunkiness? Surely you mean selectivity, no? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mai

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Richard Hipp
On Tue, Sep 13, 2011 at 8:21 AM, François wrote: > Richard, Igor, > > I made some tests based on a) and b) cases described by Igor. > > I can see much faster SELECT with an index than without it: so Igor > seems to be right. Richard, can you tell me in what cases performance > will be less good? >

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Igor Tandetnik
Simon Slavin wrote: > On 13 Sep 2011, at 1:07pm, François wrote: > >> Can we consider that creating an index for an integer field is a good >> practice if this field has at least 3 possible values ? Or more ? > > It's about chunkiness, and which of the values you're looking for. > > If all poss

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread François
Richard, Igor, I made some tests based on a) and b) cases described by Igor. I can see much faster SELECT with an index than without it: so Igor seems to be right. Richard, can you tell me in what cases performance will be less good? Thank you, Best Regards, François On 13 sep, 14:12, Franço

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Simon Slavin
On 13 Sep 2011, at 1:07pm, François wrote: > Can we consider that creating an index for an integer field is a good > practice if this field has at least 3 possible values ? Or more ? It's about chunkiness, and which of the values you're looking for. If all possible values are equally distribute

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread François
Thank you Igor!. Igor, your a) and b) cases do concern me. But reading your both answers I am quite confused now :-) Best Regards, François On 13 sep, 14:03, "Igor Tandetnik" wrote: > François wrote: > > Let us consider a table "ITEM" with a BOOLEAN field "FLAG". This table > > may contain u

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread François
Hello Richard, and thank you for this fast answer. Can we consider that creating an index for an integer field is a good practice if this field has at least 3 possible values ? Or more ? Best Regards, François On 13 sep, 13:33, Richard Hipp wrote: > On Tue, Sep 13, 2011 at 6:23 AM, François >

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Igor Tandetnik
François wrote: > Let us consider a table "ITEM" with a BOOLEAN field "FLAG". This table > may contain up to 100 000 entries and those entries can be selected > using "WHERE ITEM.FLAG = ?" conditions. > > Is then a good or a bad practice to add an index on this field if we > want to improve SELEC

Re: [sqlite] Index on BOOLEAN field

2011-09-13 Thread Richard Hipp
On Tue, Sep 13, 2011 at 6:23 AM, François wrote: > Hello, > > Let us consider a table "ITEM" with a BOOLEAN field "FLAG". This table > may contain up to 100 000 entries and those entries can be selected > using "WHERE ITEM.FLAG = ?" conditions. > > Is then a good or a bad practice to add an index

[sqlite] Index on BOOLEAN field

2011-09-13 Thread François
Hello, Let us consider a table "ITEM" with a BOOLEAN field "FLAG". This table may contain up to 100 000 entries and those entries can be selected using "WHERE ITEM.FLAG = ?" conditions. Is then a good or a bad practice to add an index on this field if we want to improve SELECT time execution ? P