Re: High CPU usage after partitioning

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: rudi <rudolone(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: High CPU usage after partitioning
Date: 2013-01-22 14:46:24
Message-ID: 50FEA640.10201@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On 01/22/2013 09:21 AM, rudi wrote:
> On Tue, Jan 22, 2013 at 3:04 PM, Merlin Moncure <mmoncure(at)gmail(dot)com
> <mailto:mmoncure(at)gmail(dot)com>> wrote:
>
> let's see the query -- it's probably written in such a way so as to
> not be able to be optimized through CE.
>
>
> The query is pretty simple and standard, the behaviour (and the plan)
> is totally different when it comes to a partitioned table.
>
> Partioned table query => explain analyze SELECT "sb_logs".* FROM
> "sb_logs" WHERE (device_id = 901 AND date_taken = (SELECT
> MAX(date_taken) FROM sb_logs WHERE device_id = 901));
>

And there you have it. Constraint exclusion does not work in cases like
this. It only works with static expressions (such as a literal date in
this case).

cheers

andrew

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message rudi 2013-01-22 15:08:09 Re: High CPU usage after partitioning
Previous Message rudi 2013-01-22 14:21:56 Re: High CPU usage after partitioning