Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dBkVP-0003Fv-8e for pgsql-performance@arkaria.postgresql.org; Fri, 19 May 2017 16:11:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dBkVO-0001iI-Ru for pgsql-performance@arkaria.postgresql.org; Fri, 19 May 2017 16:11:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dBkTb-0002YS-FW for pgsql-performance@postgresql.org; Fri, 19 May 2017 16:10:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dBkTZ-0001dt-0Q for pgsql-performance@postgresql.org; Fri, 19 May 2017 16:10:02 +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 v4JG9wj6000438; Fri, 19 May 2017 12:09:58 -0400 From: Tom Lane To: Adam Brusselback cc: pgsql-performance@postgresql.org Subject: Re: GIN index not used if created in the same transaction as query In-reply-to: References: <31274.1495208001@sss.pgh.pa.us> Comments: In-reply-to Adam Brusselback message dated "Fri, 19 May 2017 11:49:32 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <436.1495210198.1@sss.pgh.pa.us> Date: Fri, 19 May 2017 12:09:58 -0400 Message-ID: <437.1495210198@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-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Adam Brusselback writes: > Is there any easy way I can know if an index is usable or not? Are there > any catalog views or anything I could check that in? IIRC, you can look at pg_index.indcheckxmin --- if that's set, then the index had broken HOT chains during creation and may not be usable right away. Telling whether your own transaction can use it is harder from SQL level, but if you're in the same transaction that made the index then the answer is probably always "no" :-( regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance