Re: postrgesql query planner wrong desicion - Mailing list pgsql-admin

From Jeff Janes
Subject Re: postrgesql query planner wrong desicion
Date
Msg-id CAMkU=1yz+e77KzUcemnspg_AOJvxzDxh+j-b1_8f_o3uL5HVAQ@mail.gmail.com
Whole thread Raw
In response to postrgesql query planner wrong desicion  (Kenny Bachman <kenny.bachman17@gmail.com>)
List pgsql-admin


On Fri, Jun 17, 2022 at 4:48 AM Kenny Bachman <kenny.bachman17@gmail.com> wrote:
Hello Team,

I have a 12.11 postgresql database on Linux. When I ran the below query, the query planner uses the gist index. However, the query runs faster if I drop the gist index, because the query planner uses the b-tree index. Why does the query planner use the gist index instead of the b-tree?

Please show the definition of both indexes.  Also, eliminate the joins and where clause conditions which are not needed to reproduce the base problem, then show the full plans, not just one line.

Cheers,

Jeff

pgsql-admin by date:

Previous
From: Kenny Bachman
Date:
Subject: Re: postrgesql query planner wrong desicion
Next
From: Jeff Janes
Date:
Subject: Re: postrgesql query planner wrong desicion