Re: [sqlite] auntondex with unique and integer primary key

2017-05-25 Thread Simon Slavin
On 26 May 2017, at 2:47am, James K. Lowden wrote: > Nothing about any SQL statement implies anything about the > implementation. Thus, as you know, a unique constraint is not an > instruction to build an index, much less a requirement to build a > redundant one. It's

Re: [sqlite] auntondex with unique and integer primary key

2017-05-25 Thread James K. Lowden
On Fri, 19 May 2017 13:06:23 -0600 "Keith Medcalf" wrote: > You asked for the extra index to be created in the table > specification. It is not the job of the database engine to correct > your errors (it is not even possible to know if it is an error). He didn't ask.

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread David Raymond
Subject: Re: [sqlite] auntondex with unique and integer primary key Perhaps there is a reason that you want a separate unique index. Maybe the table has 15000 columns and from time to time you just need to be able to scan the used RowIDs without incurring the penalty of wafting to and fr

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Paul Sanderson
Ahh - I always let SQLite decide what index to use as I assume that it knows best. I have never used "indexed by" to force the use of a specific index - I see the issue with backward compatibility now. Thanks Richard Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Keith Medcalf
:sqlite-users-boun...@mailinglists.sqlite.org] > On Behalf Of Paul Sanderson > Sent: Friday, 19 May, 2017 11:22 > To: General Discussion of SQLite Database > Subject: [sqlite] auntondex with unique and integer primary key > > Is the autoindex associated when using unique with an

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Richard Hipp
On 5/19/17, Paul Sanderson wrote: > > Yes Unique is redundant in the create statement, but it would be a small > optimisation, unless I am missing something, for SQLite to detect this and > not create the autoindex to start with. > That would be great, if we had

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Paul Sanderson
08 PM > > To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> > > Subject: Re: [sqlite] auntondex with unique and integer primary key > > > I just thought it might be an area for optimisation as a redundant index > is > > built. > > According to

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Joseph L. Casale
> -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On > Behalf Of Paul Sanderson > Sent: Friday, May 19, 2017 12:08 PM > To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> > Subject: Re: [sqlite] auntondex

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Paul Sanderson
Thanks Simon I am aware that a PK must be unique :) It's not me that's declaring it as unique - I get to look at thousands of databases that other people create and it is these where I have noticed it (Chrome and Skype are two). I just thought it might be an area for optimisation as a redundant

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread J. King
On May 19, 2017 1:21:49 PM EDT, Paul Sanderson wrote: >Is the autoindex associated when using unique with an integer primary >key >definition redundant? > >I have seen a number of DBs/tables created in the following form: > >Create table test(id integer unique

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Simon Slavin
On 19 May 2017, at 6:21pm, Paul Sanderson wrote: > Is the autoindex associated when using unique with an integer primary key > definition redundant? > > I have seen a number of DBs/tables created in the following form: > > Create table test(id integer unique

Re: [sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Joseph L. Casale
> -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On > Behalf Of Paul Sanderson > Sent: Friday, May 19, 2017 11:22 AM > To: General Discussion of SQLite Database us...@mailinglists.sqlite.org> > Subject: [sqlite]

[sqlite] auntondex with unique and integer primary key

2017-05-19 Thread Paul Sanderson
Is the autoindex associated when using unique with an integer primary key definition redundant? I have seen a number of DBs/tables created in the following form: Create table test(id integer unique primary key); Insert into test values (1); Insert into test values (2); Insert into test values