Re: Decrease time needed to CREATE INDEX and FOREIGN KEY on new tablecolumn which has all values NULL - Mailing list pgsql-general

From Ravi Krishna
Subject Re: Decrease time needed to CREATE INDEX and FOREIGN KEY on new tablecolumn which has all values NULL
Date
Msg-id 038B7823-6C23-4606-9F1B-2B6BA097FDF9@fastmail.com
Whole thread Raw
In response to Decrease time needed to CREATE INDEX and FOREIGN KEY on new tablecolumn which has all values NULL  (Denisa Cirstescu <Denisa.Cirstescu@tangoe.com>)
List pgsql-general
> The table is huge and it takes a lot of time to add the INDEX and the FOREIGN KEY although all values are NULL.
> Considering that the new DepartmentId column is NULL for all rows at this point, is there a way to make the INDEX and
FOREIGNKEY creation run faster? 

In your script to create index add this:

set maintenance_work_mem = '1GB'
or any other figure you feel comfortable.




pgsql-general by date:

Previous
From: Denisa Cirstescu
Date:
Subject: Decrease time needed to CREATE INDEX and FOREIGN KEY on new tablecolumn which has all values NULL
Next
From: Alvaro Herrera
Date:
Subject: Re: Decrease time needed to CREATE INDEX and FOREIGN KEY on newtable column which has all values NULL