Re: BUG #12933: Custom prepared plan vs partitioning. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #12933: Custom prepared plan vs partitioning.
Date
Msg-id 23074.1427826337@sss.pgh.pa.us
Whole thread Raw
In response to BUG #12933: Custom prepared plan vs partitioning.  (maxim.boguk@gmail.com)
Responses Re: BUG #12933: Custom prepared plan vs partitioning.  (Maxim Boguk <maxim.boguk@gmail.com>)
List pgsql-bugs
maxim.boguk@gmail.com writes:
> I found case when custom plans with partitioning shows strange behavior.
> First 5 repetitions of execute with the same parameters I getting fast
> custom plan, on 6th run plan switch to slow generic (all-partitions)
> version.

This behavior is expected; after half a dozen trials the plancache will
decide it's not getting enough win from custom plans to justify replanning
every time.  For a cost delta of about 0.6 unit I would have to agree with
it.  You may have a real case where it's doing something wrong, but this
toy example doesn't demonstrate a bug IMO.

            regards, tom lane

pgsql-bugs by date:

Previous
From: maxim.boguk@gmail.com
Date:
Subject: BUG #12933: Custom prepared plan vs partitioning.
Next
From: wiltoma@gmail.com
Date:
Subject: BUG #12912: pgAdmin III : set fonts preferences makes pgAdmin to crash