Re: Slow query performance on large table - Mailing list pgsql-performance

From Josh Berkus
Subject Re: Slow query performance on large table
Date
Msg-id 200303040914.44390.josh@agliodbs.com
Whole thread Raw
In response to Re: Slow query performance on large table  ("Paul McKay" <paul_mckay@clearwater-it.co.uk>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Robert Treat
Date:
Subject: Re: Slow query performance on large table
Next
From: "Paul McKay"
Date:
Subject: Re: Slow query performance on large table