pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Evgeny Shishkin <itparanoia@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Claudio Freire <klaussfreire@gmail.com>
Cc: AI Rumman <rummandba@gmail.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Why does the number of rows are different in actual and estimated.
Date: Fri, 14 Dec 2012 03:50:19 +0400
Message-ID: <66FFC2DE-017B-4BD7-9E69-6A9982FD4A0E@gmail.com> (raw)
In-Reply-To: <14685.1355441814@sss.pgh.pa.us>
References: <CAGoODpdaGPEOyAPkWvLD=0xfQ=k-a8B_fT=Tb6QJ0uNrDv=Hvg@mail.gmail.com>
	<50CA586A.30008@dunslane.net>
	<CAGTBQpZrERogVMvzAXouhvq-ERYtSUnR6QUk2EMJren0aB-PNQ@mail.gmail.com>
	<50CA6036.6000107@dunslane.net>
	<F32F9E7A-1271-4864-AD2D-F95DC251D60D@gmail.com>
	<14685.1355441814@sss.pgh.pa.us>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>


On Dec 14, 2012, at 3:36 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Evgeny Shishkin <itparanoia@gmail.com> writes:
>> On Dec 14, 2012, at 3:09 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
>>> Well, it looks like it's choosing a join order that's quite a bit different from the way the query is expressed, so the OP might need to play around with forcing the join order some.
> 
>> OP joins 8 tables, and i suppose join collapse limit is set to default 8. I thought postgresql's optimiser is not mysql's.
> 
> It's not obvious to me that there's anything very wrong with the plan.
> An 8-way join that produces 150K rows is unlikely to run in milliseconds
> no matter what the plan.  The planner would possibly have done the last
> join step differently if it had had a better rowcount estimate, but even
> if that were free the query would still have been 7 seconds (vs 8.5).
> 

May be in this case it is. I once wrote to this list regarding similar problem - joining 4 tables, result set are off by 2257 times - 750ms vs less then 1ms. Unfortunately the question was not accepted to the list.

I spoke to Bruce Momjian about that problem on one local conference, he said shit happens :)  

> 			regards, tom lane



-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (20+ messages)  latest in thread

Message-ID: <66FFC2DE-017B-4BD7-9E69-6A9982FD4A0E@gmail.com>
Permalink:  ../66FFC2DE-017B-4BD7-9E69-6A9982FD4A0E@gmail.com/
Also on:    postgresql.org/message-id/66FFC2DE-017B-4BD7-9E69-6A9982FD4A0E@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: itparanoia@gmail.com, tgl@sss.pgh.pa.us, andrew@dunslane.net, klaussfreire@gmail.com, rummandba@gmail.com
  Subject: Re: Why does the number of rows are different in actual and estimated.
  In-Reply-To: <66FFC2DE-017B-4BD7-9E69-6A9982FD4A0E@gmail.com>
  References: <CAGoODpdaGPEOyAPkWvLD=0xfQ=k-a8B_fT=Tb6QJ0uNrDv=Hvg@mail.gmail.com> <50CA586A.30008@dunslane.net> <CAGTBQpZrERogVMvzAXouhvq-ERYtSUnR6QUk2EMJren0aB-PNQ@mail.gmail.com> <50CA6036.6000107@dunslane.net> <F32F9E7A-1271-4864-AD2D-F95DC251D60D@gmail.com> <14685.1355441814@sss.pgh.pa.us> <66FFC2DE-017B-4BD7-9E69-6A9982FD4A0E@gmail.com>

* 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