Re: Speeding up Aggregates

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Dror Matalon <dror(at)zapatec(dot)com>
Cc: Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Speeding up Aggregates
Date: 2003-10-03 21:44:49
Message-ID: 1065217488.91586.3.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> item_max_date() looks like this:
> select max(dtstamp) from items where channel = $1 and link = $2;

It is too bad the (channel, link) index doesn't have dtstamp at the end
of it, otherwise the below query would be a gain (might be a small one
anyway).

select dtstamp
from items
where channel = $1
and link = $2
ORDER BY dtstamp DESC
LIMIT 1;

Could you show us the exact specification of the function? In
particular, did you mark it VOLATILE, IMMUTABLE, or STABLE?

I hope it isn't the first or second one ;)

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Rob Nagler 2003-10-03 21:47:01 Re: reindex/vacuum locking/performance?
Previous Message Josh Berkus 2003-10-03 21:35:46 Re: Speeding up Aggregates