Re: [GENERAL] Cannot reproduce why a query is slow

2011-07-27 Thread John Cheng
Sorry about the long wait between reply. On Sat, May 7, 2011 at 2:36 PM, Tomas Vondra wrote: > Resource usually means there's too much I/O so the query is slow, but > when you try it later the drives are idle and query runs much faster. > Run some monitoring, e.g. even a simple 'iostat -x' or 'd

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-07 Thread Tomas Vondra
Dne 5.5.2011 17:02, John Cheng napsal(a): > Hi, > We have certain types of query that seems to take about 900ms to run > according to postgres logs. When I try to run the same query via > command line with "EXPLAIN ANALYZE", the query finishes very quickly. > What should I do to try to learn more a

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-06 Thread pasman pasmański
Try auto_explain module. 2011/5/5, John Cheng : > Hi, > We have certain types of query that seems to take about 900ms to run > according to postgres logs. When I try to run the same query via > command line with "EXPLAIN ANALYZE", the query finishes very quickly. > What should I do to try to learn

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-05 Thread John Cheng
On Thu, May 5, 2011 at 10:01 AM, Andrew Sullivan wrote: > On Thu, May 05, 2011 at 09:27:47AM -0700, John Cheng wrote: > >> I have a couple of queries that allow me to see the active locks in >> the database. It might help me see if these queries are blocked by >> other locking queries. > > Yes.  T

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-05 Thread Andrew Sullivan
On Thu, May 05, 2011 at 09:27:47AM -0700, John Cheng wrote: > I have a couple of queries that allow me to see the active locks in > the database. It might help me see if these queries are blocked by > other locking queries. Yes. The pg_locks view is your friend here. > In terms of IO limits, t

Re: [GENERAL] Cannot reproduce why a query is slow

2011-05-05 Thread John Cheng
On Thu, May 5, 2011 at 8:54 AM, Andrew Sullivan wrote: > On Thu, May 05, 2011 at 08:02:46AM -0700, John Cheng wrote: > >> We have certain types of query that seems to take about 900ms to run >> according to postgres logs. When I try to run the same query via >> command line with "EXPLAIN ANALYZE",