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 1ikV43-00007h-PC for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Dec 2019 15:28:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ikV32-0003er-VO for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Dec 2019 15:27:36 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1ikV32-0003ek-NS for pgsql-bugs@lists.postgresql.org; Thu, 26 Dec 2019 15:27:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ikV2y-0006W9-Ky for pgsql-bugs@lists.postgresql.org; Thu, 26 Dec 2019 15:27:35 +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 xBQFRRE3005410; Thu, 26 Dec 2019 10:27:27 -0500 From: Tom Lane To: Zhihong Zhang cc: Tomas Vondra , pgsql-bugs@lists.postgresql.org Subject: Re: Indexing on JSONB field not working In-reply-to: <0AA828F3-5BA5-48CD-B229-8351ACB308D3@gmail.com> References: <0cf001d5b77f$bfe47e10$3fad7a30$@gmail.com> <20191220223005.f6w4ff4kdbgtanpz@development> <20191221114003.yo56lv3o6thdvxtn@development> <21855.1576943356@sss.pgh.pa.us> <0AA828F3-5BA5-48CD-B229-8351ACB308D3@gmail.com> Comments: In-reply-to Zhihong Zhang message dated "Thu, 26 Dec 2019 10:17:51 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <5408.1577374047.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 26 Dec 2019 10:27:27 -0500 Message-ID: <5409.1577374047@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Zhihong Zhang writes: > Just came back from the long break and I couldn=E2=80=99t quite follow t= he threads. Is this a bug or something I am doing wrong? We're wondering why the optimizer doesn't derive a better rowcount estimate, and waiting on you to provide information about what the relevant pg_stats entries are. regards, tom lane