Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-23 Thread Dawid Kuroczko
On 7/22/07, Vincenzo Romano <[EMAIL PROTECTED]> wrote: On Sunday 22 July 2007 19:20:08 Tom Lane wrote: > Vincenzo Romano <[EMAIL PROTECTED]> writes: > > In the original setup, the "UNIQUE" constraint had been dropped > > *before* doing the tests. So the "slow" case is without the > > UNIQUE const

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-22 Thread Tom Lane
Vincenzo Romano <[EMAIL PROTECTED]> writes: > On Sunday 22 July 2007 19:20:08 Tom Lane wrote: >> With what index, pray tell? > In the original setup, the "UNIQUE" constraint had been dropped > *before* doing the tests. So the "slow" case is without the > UNIQUE constraint but with an index on NOT

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-22 Thread Vincenzo Romano
On Sunday 22 July 2007 19:20:08 Tom Lane wrote: > Vincenzo Romano <[EMAIL PROTECTED]> writes: > > In the original setup, the "UNIQUE" constraint had been dropped > > *before* doing the tests. So the "slow" case is without the > > UNIQUE constraint but with an index. The NOT NULL was instead > > the

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-22 Thread Tom Lane
Vincenzo Romano <[EMAIL PROTECTED]> writes: > In the original setup, the "UNIQUE" constraint had been dropped > *before* doing the tests. So the "slow" case is without the UNIQUE > constraint but with an index. The NOT NULL was instead there. With what index, pray tell? re

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-22 Thread Vincenzo Romano
On Saturday 21 July 2007 08:00:11 Tom Lane wrote: > "Josh Tolley" <[EMAIL PROTECTED]> writes: > > Might it just be that the original UNIQUE + NOT NULL index was > > bloated or otherwise degraded, and reindexing it would have > > resulted in the same performance gain? That's just a guess. > > Yeah.

[GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-21 Thread Vincenzo Romano
Hi all. Maybe mine is a stupid question, but I'd like to know the answer if possible. In an inner join involving a 16M+ rows table and a 100+ rows table performances got drastically improved by 100+ times by replacing a UNIQUE-NOT NULL index with a PRIMARY KEY on the very same columns in the ver

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Tom Lane
"Josh Tolley" <[EMAIL PROTECTED]> writes: > Might it just be that the original UNIQUE + NOT NULL index was bloated > or otherwise degraded, and reindexing it would have resulted in the > same performance gain? That's just a guess. Yeah. There is precious little difference between UNIQUE+NOT NULL

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Josh Tolley
On 7/20/07, Michael Glaesemann <[EMAIL PROTECTED]> wrote: On Jul 20, 2007, at 17:54 , Vincenzo Romano wrote: > In an inner join involving a 16M+ rows table and a 100+ rows table > performances got drastically improved by 100+ times by replacing a > UNIQUE-NOT NULL index with a PRIMARY KEY on th

Re: [GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Michael Glaesemann
On Jul 20, 2007, at 17:54 , Vincenzo Romano wrote: In an inner join involving a 16M+ rows table and a 100+ rows table performances got drastically improved by 100+ times by replacing a UNIQUE-NOT NULL index with a PRIMARY KEY on the very same columns in the very same order. The query has not be

[GENERAL] Difference between PRIMARY KEY index and UNIQUE-NOT NULL index

2007-07-20 Thread Vincenzo Romano
Hi all. Maybe mine is a stupid question, but I'd like to know the answer if possible. In an inner join involving a 16M+ rows table and a 100+ rows table performances got drastically improved by 100+ times by replacing a UNIQUE-NOT NULL index with a PRIMARY KEY on the very same columns in the ver