pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris Withers <chris@withers.org>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: surprisingly slow creation of gist index used in exclude constraint
Date: Thu, 14 May 2020 16:31:10 -0400
Message-ID: <1424.1589488270@sss.pgh.pa.us> (raw)
In-Reply-To: <789b3464-9bfc-2157-f4f4-71eb1da1050d@withers.org>
References: <789b3464-9bfc-2157-f4f4-71eb1da1050d@withers.org>

Chris Withers <chris@withers.org> writes:
>       It has 4.1 million rows in it and while importing the data only
>       takes a couple of minutes, when I did a test load into the new
>       cluster, building the mkt_profile_period_col1_col4_col2_chan_excl
>       index for the exclude constraint took 15 hours.

Don't recall for sure, but I think GIST index build is sensitive
to the maintenance_work_mem setting; did you have that cranked up?

>     - failing that, what can I do to import and then create the index
>       in the background?

CREATE INDEX CONCURRENTLY, perhaps.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <1424.1589488270@sss.pgh.pa.us>
Permalink:  ../1424.1589488270@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1424.1589488270@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chris@withers.org
  Subject: Re: surprisingly slow creation of gist index used in exclude constraint
  In-Reply-To: <1424.1589488270@sss.pgh.pa.us>
  References: <789b3464-9bfc-2157-f4f4-71eb1da1050d@withers.org> <1424.1589488270@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox