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 1lFIEH-00075i-6T for pgsql-general@arkaria.postgresql.org; Thu, 25 Feb 2021 15:07:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lFIEF-0007ic-Pk for pgsql-general@arkaria.postgresql.org; Thu, 25 Feb 2021 15:06:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFIEF-0007iV-Ib for pgsql-general@lists.postgresql.org; Thu, 25 Feb 2021 15:06:59 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFIED-0003uI-9e for pgsql-general@lists.postgresql.org; Thu, 25 Feb 2021 15:06:59 +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 11PF6sAW108776; Thu, 25 Feb 2021 10:06:54 -0500 From: Tom Lane To: Eric Brison cc: pgsql-general@lists.postgresql.org Subject: Re: Extension intarray and null values In-reply-to: References: Comments: In-reply-to Eric Brison message dated "Thu, 25 Feb 2021 15:31:33 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <108774.1614265614.1@sss.pgh.pa.us> Date: Thu, 25 Feb 2021 10:06:54 -0500 Message-ID: <108775.1614265614@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Eric Brison writes: > I use tables with several "int[]" columns. > I use the "@>" operator to filter my data. > To increase speed , i install the "intarray" extension. Now queries are > very fast with the specific indexes (i use "gin__int_ops"). > But, in few columns, i have null values in my intarray and i cannot use the > "@>" operator. Do you really need to use intarray, rather than the built-in gin array indexing features? Yeah, the intarray implementation is probably a shade faster, but it's faster precisely because it doesn't handle cases like null entries. If you're in need of that, my suggestion is to ditch intarray. regards, tom lane