pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: rudi <rudolone@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: High CPU usage after partitioning
Date: Tue, 22 Jan 2013 09:46:24 -0500
Message-ID: <50FEA640.10201@dunslane.net> (raw)
In-Reply-To: <CAMxPiKF-O7C+LUdJuudZYXxdwgagoYMcgZNvsuTMmPTyXASm-w@mail.gmail.com>
References: <CAMxPiKHyJkMAqO62wH6aVzpvpfxhHd_P4pZZRgTCAdxLAnLeCw@mail.gmail.com>
	<50FDE039.3030601@dunslane.net>
	<CAMxPiKFW1VaMXo7HoH6fd3deQ1LJ4wU3DEAWG0sYjyg1nRq-_Q@mail.gmail.com>
	<CAHyXU0zgFTdf57=ZmK0ATG5yM37SYmBcwyaq4Psm+qi5ke6wZg@mail.gmail.com>
	<CAMxPiKF-O7C+LUdJuudZYXxdwgagoYMcgZNvsuTMmPTyXASm-w@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>


On 01/22/2013 09:21 AM, rudi wrote:
> On Tue, Jan 22, 2013 at 3:04 PM, Merlin Moncure <mmoncure@gmail.com 
> <mailto:mmoncure@gmail.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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (11+ messages)  latest in thread

Message-ID: <50FEA640.10201@dunslane.net>
Permalink:  ../50FEA640.10201@dunslane.net/
Also on:    postgresql.org/message-id/50FEA640.10201@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: andrew@dunslane.net, rudolone@gmail.com
  Subject: Re: High CPU usage after partitioning
  In-Reply-To: <50FEA640.10201@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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