pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6112: heuristic for empty parent tables that are members of inheritance trees
2+ messages / 2 participants
[nested] [flat]
* BUG #6112: heuristic for empty parent tables that are members of inheritance trees
@ 2011-07-11 16:51 Anish Kejariwal <anishkej@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Anish Kejariwal @ 2011-07-11 16:51 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged online:
Bug reference: 6112
Logged by: Anish Kejariwal
Email address: anishkej@gmail.com
PostgreSQL version: 9.0.3
Operating system: Linux
Description: heuristic for empty parent tables that are members of
inheritance trees
Details:
Hello,
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
inheritance trees."
All information is in:
http://archives.postgresql.org/pgsql-performance/2011-07/msg00063.php
Scenario:
-empty parent table
-all data is in child/partitioned tables
Bug:
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
execution plan.
Work around:
Tom Lane suggested the following workaround to "defeat the empty-table
heuristic:
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.
Anish
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #6112: heuristic for empty parent tables that are members of inheritance trees
@ 2011-07-18 14:58 Robert Haas <robertmhaas@gmail.com>
parent: Anish Kejariwal <anishkej@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Robert Haas @ 2011-07-18 14:58 UTC (permalink / raw)
To: Anish Kejariwal <anishkej@gmail.com>; +Cc: pgsql-bugs
On Mon, Jul 11, 2011 at 12:51 PM, Anish Kejariwal <anishkej@gmail.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: 6112
> Logged by: Anish Kejariwal
> Email address: anishkej@gmail.com
> PostgreSQL version: 9.0.3
> Operating system: Linux
> Description: heuristic for empty parent tables that are members of
> inheritance trees
> Details:
>
> Hello,
>
> 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
> inheritance trees."
>
> All information is in:
> http://archives.postgresql.org/pgsql-performance/2011-07/msg00063.php
>
> Scenario:
> -empty parent table
> -all data is in child/partitioned tables
>
> Bug:
> 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
> execution plan.
>
> Work around:
> Tom Lane suggested the following workaround to "defeat the empty-table
> heuristic:
> 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.
Tom fixed this in commit f3ff0433ab32fdc69da3c8f8e691ef6b4366559c on July 14th.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-07-18 14:58 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11 16:51 BUG #6112: heuristic for empty parent tables that are members of inheritance trees Anish Kejariwal <anishkej@gmail.com>
2011-07-18 14:58 ` Robert Haas <robertmhaas@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox