Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHm9l-0003Rw-TF for pgsql-general@arkaria.postgresql.org; Tue, 08 Oct 2019 09:51:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHm9k-0007d1-MU for pgsql-general@arkaria.postgresql.org; Tue, 08 Oct 2019 09:51:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHm9k-0007co-9y for pgsql-general@lists.postgresql.org; Tue, 08 Oct 2019 09:51:48 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1iHm9d-0007HM-Kk for pgsql-general@postgresql.org; Tue, 08 Oct 2019 09:51:47 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 0A49017C1B2AC for ; Tue, 8 Oct 2019 02:51:40 -0700 (MST) Date: Tue, 8 Oct 2019 02:51:40 -0700 (MST) From: PegoraroF10 To: pgsql-general@postgresql.org Message-ID: <1570528300014-0.post@n3.nabble.com> In-Reply-To: References: <1570027063947-0.post@n3.nabble.com> <1570048895867-0.post@n3.nabble.com> <1570286972307-0.post@n3.nabble.com> <1570297030805-0.post@n3.nabble.com> Subject: Re: Performance on JSONB select MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Sorry, I told you that the status was always populated but not, I need that filter for the index because not all records are using that json structure. When json is not null then yes, Status is always there. I have maybe 20 or 25% of records having json populated, so, I really need that filter. Yes, that solution is fine. Selectivity is fine, speed is fine and the index is "almost dynamic" -- Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html