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

From Richard Huxton
Subject Re: totally different plan when using partitions
Date
Msg-id 4A843818.1020500@archonet.com
Whole thread Raw
In response to Re: totally different plan when using partitions  (Scara Maccai <m_lists@yahoo.it>)
Responses Re: totally different plan when using partitions  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Looping through string constants
Next
From: Pavel Stehule
Date:
Subject: Re: comparing NEW and OLD (any good this way?)