Re: Common slow query reasons - help with a special log

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Common slow query reasons - help with a special log
Date: 2011-12-11 03:11:22
Message-ID: 4EE41F5A.60305@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Anibal David Acosta 2011-12-12 14:25:43 autovacuum, exclude table
Previous Message Jon Nelson 2011-12-11 03:08:39 Re: copy vs. C function