Re: How can I make PostgreSQL to select another quey plan? - Mailing list pgsql-novice

From Tom Lane
Subject Re: How can I make PostgreSQL to select another quey plan?
Date
Msg-id 12839.1322670219@sss.pgh.pa.us
Whole thread Raw
In response to Re: How can I make PostgreSQL to select another quey plan?  (Yangyang <yangyangbm@gmail.com>)
Responses Re: How can I make PostgreSQL to select another quey plan?  (Yangyang <yangyangbm@gmail.com>)
List pgsql-novice
Yangyang <yangyangbm@gmail.com> writes:
> If I don't change the database structures (like index), and only
> modify "Planner cost constants", is it possible to make DB change the
> query plan?

Yes, but usually these don't have huge impacts on estimated costs,
so you will only be able to get it to switch to plans that (it thinks)
are relatively close in cost anyway.

A bigger question is what sort of plan you think would be better, and
whether the planner is even capable of building that plan from the
given query.  You didn't show the particular query you're concerned
about, but I gather from the EXPLAIN output that it involves
sub-selects, and those can act as optimization fences ...

            regards, tom lane

pgsql-novice by date:

Previous
From: Yangyang
Date:
Subject: Re: How can I make PostgreSQL to select another quey plan?
Next
From: Yangyang
Date:
Subject: Re: How can I make PostgreSQL to select another quey plan?