Re: [GENERAL] Primary key vs unique index

2012-07-06 Thread Gurjeet Singh
On Fri, Jul 6, 2012 at 2:07 PM, rverghese wrote: > Yes I am using that option for one of my POstgres 9.1 database and it works > well. But its still an issue with Foreign keys, which you need to drop and > recreate . Having to drop and create foriegn keys is a legitimate concern. I am looking i

Re: [GENERAL] Primary key vs unique index

2012-07-06 Thread rverghese
Yes I am using that option for one of my POstgres 9.1 database and it works well. But its still an issue with Foreign keys, which you need to drop and recreate . Also I use Slony for replication and it uses the primary key to check repl. So I don't want that to be interrupted by dropping PK and rec

Re: [GENERAL] Primary key vs unique index

2012-07-06 Thread Gurjeet Singh
Bloat in primary key indexes has been a long standing issue (although not faced by many), and especially since online rebuild of primary keys was never possible in production environments. Since version 9.1 we have a nice little feature of being able to change a primary key's underlying index. Loo

Re: [GENERAL] Primary key vs unique index

2012-07-06 Thread hubert depesz lubaczewski
On Fri, Jul 06, 2012 at 09:07:53AM -0700, rverghese wrote: > We are experiencing a similar problem, even though we are on 8.4 and have > been for a while, and have autovacuum turned on. I have regular concurrent > reindexes on the indexes but the primary key is seriously bloated. I was > considerin

Re: [GENERAL] Primary key vs unique index

2012-07-06 Thread rverghese
We are experiencing a similar problem, even though we are on 8.4 and have been for a while, and have autovacuum turned on. I have regular concurrent reindexes on the indexes but the primary key is seriously bloated. I was considering doing the same thing, that is, create another primary key that is

Re: [GENERAL] Primary key vs unique index

2011-03-22 Thread Voils, Steven M
Voils, Steven M Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Primary key vs unique index On Fri, Mar 18, 2011 at 6:38 AM, Voils, Steven M wrote: > What are the general guidelines under which autovacuum will trigger?  I was > unaware it was turned on by default for the newer v

Re: [GENERAL] Primary key vs unique index

2011-03-21 Thread Scott Marlowe
On Fri, Mar 18, 2011 at 6:38 AM, Voils, Steven M wrote: > What are the general guidelines under which autovacuum will trigger?  I was > unaware it was turned on by default for the newer versions.  Would it be > worthwhile to leave the manual vacuuming on?  Currently it runs immediately > after

Re: [GENERAL] Primary key vs unique index

2011-03-21 Thread Derrick Rice
On Fri, Mar 18, 2011 at 8:38 AM, Voils, Steven M wrote: > What are the general guidelines under which autovacuum will trigger? I was > unaware it was turned on by default for the newer versions. Would it be > worthwhile to leave the manual vacuuming on? Currently it runs immediately > after lar

Re: [GENERAL] Primary key vs unique index

2011-03-18 Thread Voils, Steven M
expected that autovac would pick these changes up and run anyway? -Original Message- From: Scott Marlowe [mailto:scott.marl...@gmail.com] Sent: Friday, March 18, 2011 8:36 AM To: Voils, Steven M Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Primary key vs unique index Autovacuum is

Re: [GENERAL] Primary key vs unique index

2011-03-18 Thread Voils, Steven M
, 2011 6:31 PM To: Voils, Steven M Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Primary key vs unique index On Thu, Mar 17, 2011 at 12:59 PM, Voils, Steven M wrote: > Thanks for the reply.  I should have mentioned in the first post that we do > delete significant amounts of the

Re: [GENERAL] Primary key vs unique index

2011-03-18 Thread Scott Marlowe
e- > From: Scott Marlowe [mailto:scott.marl...@gmail.com] > Sent: Thursday, March 17, 2011 6:31 PM > To: Voils, Steven M > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Primary key vs unique index > > On Thu, Mar 17, 2011 at 12:59 PM, Voils, Steven M > wr

Re: [GENERAL] Primary key vs unique index

2011-03-17 Thread Scott Marlowe
On Thu, Mar 17, 2011 at 12:59 PM, Voils, Steven M wrote: > Thanks for the reply.  I should have mentioned in the first post that we do > delete significant amounts of the table which I thought was the cause of the > bloat.  We are already performing automatic vacuums nightly. Automatic regular

Re: [GENERAL] Primary key vs unique index

2011-03-17 Thread Voils, Steven M
To: Voils, Steven M Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Primary key vs unique index On Mar 17, 2011, at 6:19 AM, Voils, Steven M wrote: > Is there a fundamental difference between a primary key and a unique index? > Currently we have primary keys on tables that have sig

Re: [GENERAL] Primary key vs unique index

2011-03-17 Thread Voils, Steven M
] Sent: Thursday, March 17, 2011 2:52 PM To: Voils, Steven M Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Primary key vs unique index On Thu, Mar 17, 2011 at 12:51 PM, Scott Marlowe wrote: > On Thu, Mar 17, 2011 at 6:19 AM, Voils, Steven M > wrote: >> Is there a fundamenta

Re: [GENERAL] Primary key vs unique index

2011-03-17 Thread Scott Marlowe
On Thu, Mar 17, 2011 at 12:51 PM, Scott Marlowe wrote: > On Thu, Mar 17, 2011 at 6:19 AM, Voils, Steven M > wrote: >> Is there a fundamental difference between a primary key and a unique index? >> Currently we have primary keys on tables that have significant amounts of >> updates performed on t

Re: [GENERAL] Primary key vs unique index

2011-03-17 Thread Scott Marlowe
On Thu, Mar 17, 2011 at 6:19 AM, Voils, Steven M wrote: > Is there a fundamental difference between a primary key and a unique index? > Currently we have primary keys on tables that have significant amounts of > updates performed on them, as a result the primary key indexes are becoming > signific

Re: [GENERAL] Primary key vs unique index

2011-03-17 Thread Scott Ribe
On Mar 17, 2011, at 6:19 AM, Voils, Steven M wrote: > Is there a fundamental difference between a primary key and a unique index? > Currently we have primary keys on tables that have significant amounts of > updates performed on them, as a result the primary key indexes are becoming > signific

[GENERAL] Primary key vs unique index

2011-03-17 Thread Voils, Steven M
Is there a fundamental difference between a primary key and a unique index? Currently we have primary keys on tables that have significant amounts of updates performed on them, as a result the primary key indexes are becoming significantly bloated. There are other indexes on the tables that al