On 07/06/2012 02:17 PM, Yan Chunlu wrote:
> so I wonder could this simple select is innocent and affected badly by
> other queries? how could I find those queries that really slow down
> the database?
It might not be other queries. Your query could be taking that long
because it was blocked by a lock during maintenance work (say, an ALTER
TABLE). It's also quite possible that it was held up by a slow
checkpoint; check your logs to see if there are warnings about
checkpoint activity.
--
Craig Ringer