Re: Very long index build time

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Scalia <jayknowsunix(at)gmail(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Very long index build time
Date: 2017-02-09 17:46:43
Message-ID: 18942.1486662403@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

John Scalia <jayknowsunix(at)gmail(dot)com> writes:
> I'm building a test database for our data warehouse,and I'm trying to build
> a trigram index on one of the tables with a 4000 character varchar field,
> Yes, I want to change this table at some point to make that attribute a
> text field, along with some other structural changes. but that's in the
> future. This particular table reports to be approximately 420 Gb. My
> question is fairly simple, this index has been building since Tuesday
> morning @ 9:52AM EST - nearly 48 hours. Does this sound like a normal build
> time? The command I used is:

> CREATE INDEX CONCURRENTLY test_schema_notes_trigram_idx on
> test_schema.notes USING gin (notes gin_trgm_ops);

Well, the first question is whether the index building session is actually
doing anything or just waiting. Is it consuming CPU time? It might just
be waiting around for some other transaction to finish --- there are
multiple places in a CREATE INDEX CONCURRENTLY sequence where we have to
wait out all other open transactions.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gunnar "Nick" Bluth 2017-02-10 10:23:20 Re: postgresql : could not serialize access due to read/write dependencies among transactions
Previous Message Jorge Torralba 2017-02-09 17:13:30 Re: Change ownership of a database