Re: Common slow query reasons - help with a special log - Mailing list pgsql-performance

From Tomas Vondra
Subject Re: Common slow query reasons - help with a special log
Date
Msg-id 4EE41F5A.60305@fuzzy.cz
Whole thread Raw
In response to Re: Common slow query reasons - help with a special log  (Daniel Cristian Cruz <danielcristian@gmail.com>)
List pgsql-performance
On 11.12.2011 02:27, Daniel Cristian Cruz wrote:
> I would start with 5 seconds.
>
> Reading the manual again and I saw that enabling analyze, it analyze all
> queries, even the ones that wasn't 5 second slower. And understood that
> there is no way to disable for slower queries, since there is no way to
> know it before it ends...

Yes, you can't predict how long a query will run until it actually
finishes, so you have to instrument all of them. Maybe this will change
because of the "faster than light" neutrinos, but let's stick with the
current laws of physics for now.

> I read Bruce blog about some features going to multi-core. Could explain
> analyze go multi-core too?

I don't think so. This is what Bruce mentioned as "parallel execution"
and that's the very hard part requiring rearchitecting parts of the system.

> Another thing I saw is that I almost never look at times in explain
> analyze. I always look for rows divergence and methods used for scan and
> joins when looking for something to get better performance.
>
> I had the nasty idea of putting a // before de gettimeofday in the code
> for explain analyze (I guess it could be very more complicated than this).

I was thinking about that too, but I've never done it. So I'm not sure
what else is needed.

Tomas

pgsql-performance by date:

Previous
From: Jon Nelson
Date:
Subject: Re: copy vs. C function
Next
From: "Anibal David Acosta"
Date:
Subject: autovacuum, exclude table