Skip site navigation (1) Skip section navigation (2)

Re: Which indexes to drop

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: John Taylor <postgres(at)jtresponse(dot)co(dot)uk>,"PgSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Which indexes to drop
Date: 2002-06-18 15:36:15
Message-ID: web-1531591@davinci.ethosmedia.com (view raw or flat)
Thread:
Lists: pgsql-novice
John,

> I'm optimising my data load by dropping indexes.
> 
> My question is, what do I do with the indexes created by postgres for
> primary keys ?
> 
> Is it OK to drop them ?

No.

> What will happen to the constraint checking ?

It won't happen, assuming that Postgres allows the DROP INDEX statement
at all.

> How do I create them again afterwards, so that they are used
> correctly for constraint checking ?

I'm not sure that it's possible to add a primary key to an existing
populated table.

I'd reccommend instead dropping all other indexes but the primary key.
 It's just not a good idea.   How much is this slowing down the data
load?  Can you do a comparison test on a keyed vs. keyless table?

FYI, in 7.4 or 8.0 we will have DEFERRABLE UNIQUE constraints, which
means that it may be possible for you to hold the PK checking until the
data load is finished, adding some speed to the process.

-Josh Berkus

In response to

Responses

pgsql-novice by date

Next:From: John TaylorDate: 2002-06-18 15:45:27
Subject: Re: What gets inherited
Previous:From: John TaylorDate: 2002-06-18 15:19:15
Subject: What gets inherited

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group