From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Stacy White <harsh@computer.org>
Cc: Alvaro Herrera <alvherre@dcc.uchile.cl>
Cc: PFC <lists@boutiquenumerique.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: What needs to be done for real Partitioning?
Date: 20 Mar 2005 22:47:43 -0500
Message-ID: <871xa9fyn4.fsf@stark.xeocode.com> (raw)
In-Reply-To: <14172.1111359709@sss.pgh.pa.us>
References: <200503191202.38089.josh@agliodbs.com>
<op.snwojdwith1vuj@localhost>
<20050319225624.GA8467@dcc.uchile.cl>
<3404.1111277153@sss.pgh.pa.us>
<002a01c52d87$543d1010$0200a8c0@grownups>
<14172.1111359709@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Global indexes would seriously reduce the performance of both vacuum and
> cluster for a single partition, and if you want seq scans you don't need
> an index for that at all. So the above doesn't strike me as a strong
> argument for global indexes ...
I think he means some sort of plan for queries like
select * from invoices where customer_id = 1
where customer 1 only did business with us for two years. One could imagine
some kind of very coarse grained bitmap index that just knows which partitions
customer_id=1 appears in, and then does a sequential scan of those partitions.
But I think you can do nearly as well without using global indexes of any
type. Assuming you had local indexes on customer_id for each partition and
separate histograms for each partition the planner could conclude that it
needs sequential scans for some partitions and a quick index lookup expecting
0 records for other partitions.
Not as good as pruning partitions entirely but if you're doing a sequential
scan the performance hit of a few index lookups isn't a problem.
--
greg
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: gsstark@mit.edu, tgl@sss.pgh.pa.us, harsh@computer.org, alvherre@dcc.uchile.cl, lists@boutiquenumerique.com, josh@agliodbs.com
Subject: Re: What needs to be done for real Partitioning?
In-Reply-To: <871xa9fyn4.fsf@stark.xeocode.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