Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFJWO-0002c3-Vb for pgsql-general@arkaria.postgresql.org; Thu, 25 Feb 2021 16:29:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lFJWN-00023F-Ua for pgsql-general@arkaria.postgresql.org; Thu, 25 Feb 2021 16:29:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFJWN-000237-Mw for pgsql-general@lists.postgresql.org; Thu, 25 Feb 2021 16:29:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFJWL-0002gc-LN for pgsql-general@lists.postgresql.org; Thu, 25 Feb 2021 16:29:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 11PGThFK015457; Thu, 25 Feb 2021 11:29:44 -0500 From: Tom Lane To: Eric Brison cc: pgsql-general@lists.postgresql.org Subject: Re: Extension intarray and null values In-reply-to: References: <108775.1614265614@sss.pgh.pa.us> Comments: In-reply-to Eric Brison message dated "Thu, 25 Feb 2021 16:45:55 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15455.1614270583.1@sss.pgh.pa.us> Date: Thu, 25 Feb 2021 11:29:43 -0500 Message-ID: <15456.1614270583@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Eric Brison writes: > yes i a have a specific query with many rows and big int array These data > not contains null values. And in this case , i use the specific GIN index. > The query time decrease from 30s to 100ms with the index. My point is that you can also make a gin index on an integer array using the built-in array opclass. It might be a shade slower than intarray, but maybe it's 120ms instead of 100, and it'll handle nulls correctly. regards, tom lane