Paul,
> Index Scan using idx_measurement_assessment on measurement
> (cost=0.00..34668.61 rows=261 width=8) (actual time=26128.07..220584.69
> rows=503 loops=1)
> Total runtime: 220587.06 msec
These query results say to me that you need to do both a VACUUM FULL and a
REINDEX on this table. The 26-second delay before returning the first row
says "table/index with lots of dead pages" to me.
For the future, you should consider dramatically increasing your FSM settings
and working a regular VACUUM FULL and REINDEX into your maintainence jobs.
--
Josh Berkus
Aglio Database Solutions
San Francisco