Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbspf-0005Zi-MC for pgsql-admin@arkaria.postgresql.org; Thu, 09 Feb 2017 17:48:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cbspe-00051I-VI for pgsql-admin@arkaria.postgresql.org; Thu, 09 Feb 2017 17:48:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cbsnx-00038R-TM for pgsql-admin@postgresql.org; Thu, 09 Feb 2017 17:46:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cbsnu-0004jh-0q for pgsql-admin@postgresql.org; Thu, 09 Feb 2017 17:46:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v19HkhQN018943; Thu, 9 Feb 2017 12:46:43 -0500 From: Tom Lane To: John Scalia cc: "pgsql-admin@postgresql.org" Subject: Re: Very long index build time In-reply-to: References: Comments: In-reply-to John Scalia message dated "Thu, 09 Feb 2017 08:07:51 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18941.1486662403.1@sss.pgh.pa.us> Date: Thu, 09 Feb 2017 12:46:43 -0500 Message-ID: <18942.1486662403@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org John Scalia 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 -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin