Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ewELC-0004Vs-43 for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Mar 2018 21:53:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ewELB-0007Vq-45 for pgsql-bugs@arkaria.postgresql.org; Wed, 14 Mar 2018 21:53:45 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1ewELA-0007Vh-Ty for pgsql-bugs@lists.postgresql.org; Wed, 14 Mar 2018 21:53:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ewEL7-0007xv-Dv for pgsql-bugs@lists.postgresql.org; Wed, 14 Mar 2018 21:53:44 +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 w2ELrbAj031903; Wed, 14 Mar 2018 17:53:37 -0400 From: Tom Lane To: acamargo@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15111: c between x and x gives bad planning In-reply-to: <152105947123.1221.6463149785118579546@wrigleys.postgresql.org> References: <152105947123.1221.6463149785118579546@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Wed, 14 Mar 2018 20:31:11 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31901.1521064417.1@sss.pgh.pa.us> Date: Wed, 14 Mar 2018 17:53:37 -0400 Message-ID: <31902.1521064417@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > Scenario: A table with columns a,b,c. Btree index on a,c. Gist index on b,c. > A query with a clause a = y and c between x and x uses the gist index b,c > instead of a,c, with very worst execution time than when c between x and z, > even with small deltas (x,z), when the btree (a,c) is used. This has been improved for v11, cf https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=7d08ce286 That won't be back-patched, though --- even if we were inclined to take the risk of doing so, the catalog changes make it impractical. regards, tom lane