> 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 ;)
signature.asc
Description: This is a digitally signed message part