From: Bruno Wolff III <bruno@wolff.to>
To: John Vincent <lusis.org@gmail.com>
Cc: Mark Lewis <mark.lewis@mir3.com>
Cc: PGSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Optimizer internals
Date: Fri, 23 Jun 2006 23:32:27 -0500
Message-ID: <20060624043227.GA13888@wolff.to> (raw)
In-Reply-To: <c841561b0606151238m333ca5cdgccd066b980a29aac@mail.gmail.com>
References: <c841561b0606151105v459d830era158b9eea5f59a7e@mail.gmail.com>
<1150396425.31200.66.camel@archimedes>
<c841561b0606151146j5f8410f2qaeaff7649b70cd20@mail.gmail.com>
<1150398064.31200.76.camel@archimedes>
<c841561b0606151221v219987aap376194583dd30940@mail.gmail.com>
<c841561b0606151238m333ca5cdgccd066b980a29aac@mail.gmail.com>
On Thu, Jun 15, 2006 at 15:38:32 -0400,
John Vincent <lusis.org@gmail.com> wrote:
> Any suggestions? FYI the original question wasn't meant as a poke at
> >comparing PG to MySQL to DB2. I'm not making an yvalue judgements either
> >way. I'm just trying to understand how we can use it the best way possible.
> >
>
> Actually we just thought about something. With PG, we can create an index
> that is a SUM of the column where indexing, no? We're going to test this in
> a few hours. Would that be able to be satisfied by an index scan?
No, that won't work. While you can make indexes on functions of a row, you
can't make indexes on aggregate functions.
You might find making a materialized view of the information you want can
help with performance. The issues with "sum" are pretty much the same ones
as with "count". You can find a couple different ways of doing materialized
views for "count" in the archives. There is a simple way of doing it that
doesn't work well with lots of concurrent updates and a more complicated
method that does work well with lots of concurrent updates.
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: bruno@wolff.to, lusis.org@gmail.com, mark.lewis@mir3.com
Subject: Re: Optimizer internals
In-Reply-To: <20060624043227.GA13888@wolff.to>
* 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