performance of partitioning? - Mailing list pgsql-general

From George Nychis
Subject performance of partitioning?
Date
Msg-id 45E43969.9080609@cmu.edu
Whole thread Raw
Responses Re: performance of partitioning?  (Jorge Godoy <jgodoy@gmail.com>)
Re: performance of partitioning?  (cedric <cedric@over-blog.com>)
Re: performance of partitioning?  (Brent Wood <b.wood@niwa.co.nz>)
List pgsql-general
Hey all,

So I have a master table called "flows" and 400 partitions in the format
"flow_*" where * is equal to some epoch.

Each partition contains ~700,000 rows and has a check such that 1 field is equal
to a value:
    "flows_1107246900_interval_check" CHECK ("interval" = '2005-02-01
03:35:00'::timestamp without time zone)

Each partition has a different and unique non-overlapping check.

This query takes about 5 seconds to execute:
dp=> select count(*) from flows_1107246900;
  count
--------
  696836
(1 row)

This query has been running for 10 minutes now and hasn't stopped:
dp=> select count(*) from flows where interval='2005-02-01 03:35:00';

Isn't partitioning supposed to make the second query almost as fast?  My WHERE
is exactly the partitioning constraint, therefore it only needs to go to 1
partition and execute the query.

Why would it take magnitudes longer to run?  Am i misunderstanding something?

Thanks!
George

pgsql-general by date:

Previous
From: Andrew Edson
Date:
Subject: How does filter order relate to query optimization?
Next
From: Jorge Godoy
Date:
Subject: Re: performance of partitioning?