Henrik,
> > Well, now it gets more complicated. You need to determine:
> > A) The median processing time of each of those requests.
> > B) The amount of Sort_mem actually required for each request.
>
> as I am dealing with postgres for a webserver the median processing
> time of each request has got to be <1 sec. how can i measure
> the amount of sort_mem needed?
Through experimentation, mostly. SInce you are in a high-volume, small-query
environment, I would try *lowering* your sort mem to see if that has an
adverse impact on queries. A good quick test would be to cut your sort_mem
in half, and then run an EXPLAIN on the query from which you expect the
largest result set, and see if the SORT time on the query has been increased.
--
-Josh Berkus
Aglio Database Solutions
San Francisco