The following bug has been logged online:
Bug reference: 6112
Logged by: Anish Kejariwal
Email address: anishkej(at)gmail(dot)com
PostgreSQL version: 9.0.3
Operating system: Linux
Description: heuristic for empty parent tables that are members of
I'm filing this issue as a bug, and it seems like Tom Lane agrees that there
is a bug, and said: " maybe we should reconsider the heuristic for tables
that are members of inheritance trees --- particularly parents of
All information is in:
-empty parent table
-all data is in child/partitioned tables
optimizer considers the parent table to be empty.
Result: The execution plan is incorrect. My particularly query took 25
seconds with the wrong execution plan, but 0.3 seconds with the correct
Tom Lane suggested the following workaround to "defeat the empty-table
update pg_class set relpages = 1 where relname = 'icecream';
I'm using this work around for now, but I don't think this is acceptable.
If someone were to accidentally run vacuum analyze on the parent table, then
the relpages will be set back to zero, and the query will run slowly.
Please let me know if you have any questions.
pgsql-bugs by date
|Next:||From: Tom Lane||Date: 2011-07-11 17:10:58|
|Subject: Re: BUG #6111: ftell mismatch error |
|Previous:||From: glum||Date: 2011-07-11 16:18:52|
|Subject: BUG #6111: ftell mismatch error|