Re: Which indexes to drop

From: John Taylor <postgres(at)jtresponse(dot)co(dot)uk>
To: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, PgSQL Novice ML <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Which indexes to drop
Date: 2002-06-19 08:24:56
Message-ID: 02061909245601.01538@splash.hq.jtresponse.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tuesday 18 June 2002 23:51, Ron Johnson wrote:
> On Tue, 2002-06-18 at 10:36, Josh Berkus wrote:
> > 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.
>
> I've done it many times...
>
> alter table t_lane_tx
> add constraint c_lane_tx_pk primary key (lane_tx_id);
>
> > > How do I create them again afterwards, so that they are used
> > > correctly for constraint checking ?
>
> In this instance, you can have speed or you can have correctness.
> Pick one. Of course, if you know that your input data is good,
> you have both...
>

I think I'm going to assume that my data is good, otherwise the load will take about 30 hours !

So do I need to:
remove the constraint
load
add the constraint
or
drop index
load
add the constraint

ie:
Will removing the constraint automatically drop the index
or
Will dropping the index remove the constraint

Thanks
JohnT

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Rory Campbell-Lange 2002-06-19 08:36:34 [repost] trigger update time
Previous Message John Taylor 2002-06-19 08:18:41 Re: in_array: Need to specify dimensions