Re: Speeding up Aggregates - Mailing list pgsql-performance

From Rod Taylor
Subject Re: Speeding up Aggregates
Date
Msg-id 1065217488.91586.3.camel@jester
Whole thread Raw
In response to Speeding up Aggregates  (Dror Matalon <dror@zapatec.com>)
Responses Re: Speeding up Aggregates
List 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 ;)

Attachment

pgsql-performance by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Speeding up Aggregates
Next
From: Rob Nagler
Date:
Subject: Re: reindex/vacuum locking/performance?