Re: totally different plan when using partitions - Mailing list pgsql-general

From Scara Maccai
Subject Re: totally different plan when using partitions
Date
Msg-id 885905.40826.qm@web24612.mail.ird.yahoo.com
Whole thread Raw
In response to Re: totally different plan when using partitions  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: totally different plan when using partitions
List pgsql-general
> Huh, clearly not the same query (you're using the partition
> directly in
> the first query) ...  Doing two changes at once is not
> helping your
> case.

Sorry, I don't understand... of course I used the partition directly in the first query... it's the difference between
thetwo... what I don't like is that since the tables used are in fact the same, the plan shouldn't be that different. 

My conclusion is that the planner thinks there could be some data in the "root" partition, even if that will always be
empty.
What I would like is a way to tell Postgres "hey, don't even look at the root table. That's just a placeholder for the
partitions.It will never contain any data" when I create the tables. 

Otherwise the planner might get fooled by an empty table index scan in a loop (which is what happens here), thinking
thatthat will take time. 







pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: multiple paramters in aggregate function
Next
From: Philip Rhoades
Date:
Subject: PostgreSQL for Firefox Bookmarks?