pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tv@fuzzy.cz>
To: pgsql-performance@postgresql.org
Subject: Re: Common slow query reasons - help with a special log
Date: Sun, 11 Dec 2011 04:11:22 +0100
Message-ID: <4EE41F5A.60305@fuzzy.cz> (raw)
In-Reply-To: <CACffM9F4JwWjE0wqkNqPrRdEPXMdbUsUnvGL8-Rq2xiZx289TQ@mail.gmail.com>
References: <CACffM9E1d9bR=xdWYoAPF2Y2NMpfE4gpRQf6vjV3QXQ5SSSLbw@mail.gmail.com>
	<4EE39620.5020703@fuzzy.cz>
	<CACffM9HcN8JY+e7O_NXTT84Oi_YHubU1_d1obpTHzBUUPotL-Q@mail.gmail.com>
	<4EE3F060.6000602@fuzzy.cz>
	<CACffM9F4JwWjE0wqkNqPrRdEPXMdbUsUnvGL8-Rq2xiZx289TQ@mail.gmail.com>

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



view thread (7+ messages)

Message-ID: <4EE41F5A.60305@fuzzy.cz>
Permalink:  ../4EE41F5A.60305@fuzzy.cz/
Also on:    postgresql.org/message-id/4EE41F5A.60305@fuzzy.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz
  Subject: Re: Common slow query reasons - help with a special log
  In-Reply-To: <4EE41F5A.60305@fuzzy.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox