From: Merlin Moncure <mmoncure@gmail.com>
To: Fei Liu <fei.liu@aepnetworks.com>
Cc: Andreas Haumer <andreas@xss.co.at>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query performance problems with partitioned tables
Date: Fri, 4 May 2007 08:07:57 +0530
Message-ID: <b42b73150705031937g7884ae55ha9cc670e26a27340@mail.gmail.com> (raw)
In-Reply-To: <4639F97D.3080003@aepnetworks.com>
References: <4635D678.3050205@xss.co.at>
<4639F97D.3080003@aepnetworks.com>
On 5/3/07, Fei Liu <fei.liu@aepnetworks.com> wrote:
> Hello, Andreas, I too am having exactly the same issue as you do.
> Comparing my partitioned and plain table performance, I've found that
> the plain tables perform about 25% faster than partitioned table. Using
> 'explain select ...', I see that constraints are being used so in
> partitioned tables fewer rows are examined. But still partitioned tables
> are 25% slower, what a let down.
That's a little bit harsh. The main use of partitioning is not to
make the table faster but to make the maintenance easier. When
constraint exclusion works well for a particular query you can get a
small boost but many queries will break down in a really negative way.
So, you are sacrificing flexibility for easier maintenance. You have
to really be careful how you use it.
The best case for partitioning is when you can logically divide up
your data so that you really only have to deal with one sliver of it
at a time...for joins and such. If the OP could force the constraint
exclusion (maybe by hashing the timestamp down to a period and using
that for where clause), his query would be fine. The problem is it's
not always easy to do that.
merlin
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: mmoncure@gmail.com, fei.liu@aepnetworks.com, andreas@xss.co.at
Subject: Re: Query performance problems with partitioned tables
In-Reply-To: <b42b73150705031937g7884ae55ha9cc670e26a27340@mail.gmail.com>
References: <4635D678.3050205@xss.co.at> <4639F97D.3080003@aepnetworks.com> <b42b73150705031937g7884ae55ha9cc670e26a27340@mail.gmail.com>
* 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