Re: totally different plan when using partitions

From: Richard Huxton <dev(at)archonet(dot)com>
To: Scara Maccai <m_lists(at)yahoo(dot)it>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: totally different plan when using partitions
Date: 2009-08-13 15:58:16
Message-ID: 4A843818.1020500@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Scara Maccai wrote:
>
> set enable_mergejoin=off;
> set enable_hashjoin=off
>
> http://explain-analyze.info/query_plans/3817-query-plan-2525

Ah, good - that's useful.

> As you can see, the 2 root partition roots (teststscell73 and teststscell13) take
>
> teststscell73: 3.90 * 30120 loops = 117468 cost
> teststscell13: 3.89 * 15964 loops = 62099 cost
>
> total: 179567 cost out of 377398 total cost of the query...

Your original "slow" query was only estimated at a cost of 70000 - it's
still going to be preferred even if you do get these to zero. Once the
cost estimates bear more of a relation to run-times things might improve.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message kbarnard 2009-08-13 16:05:08 Index utilization
Previous Message Sam Mason 2009-08-13 15:48:06 Re: Looping through string constants