pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rafael Martinez <r.m.guerrero@usit.uio.no>
To: pgsql-performance@postgresql.org
Subject: Re: SQL statement over 500% slower with 9.2 compared with 9.1
Date: Tue, 27 Aug 2013 11:19:27 +0200
Message-ID: <521C6F1F.5070901@usit.uio.no> (raw)
In-Reply-To: <521B4B2A.5010800@usit.uio.no>
References: <521B4B2A.5010800@usit.uio.no>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/26/2013 02:33 PM, Rafael Martinez wrote:
[............]
> The SQL statement is:
> 
> SELECT  firstname || ' ' || lastname AS Name FROM    Person R WHERE
> R.gender like 'F' AND  19 < (SELECT COUNT(DISTINCT filmId) FROM
> FilmParticipation F WHERE  F.partType = 'director' AND F.personId =
> R.personId    ) AND NOT EXISTS ( SELECT  * FROM
> FilmParticipation D WHERE   D.partType = 'director' AND D.personId
> = R.personId AND NOT EXISTS ( SELECT  * FROM    FilmParticipation
> C WHERE   C.partType = 'cast' AND C.filmId = D.filmId AND
> C.personId = D.personId ) ) ;
> 
> 
[.............]
> 
> We can see that the query plan is very different between versions
> and that 9.2 is really wrong with the number of rows involved. Why
> is 9.2 taking so wrong about the number of rows involved in some
> parts of the plan?
> 

Hei

More information:

If we turn off enable_indexscan the runtime gets more similar to the
one we get with 9.1, we are down to 4200ms.

The query plan with this configuration is here:
http://explain.depesz.com/s/jVR

The question remains the same, why is 9.2 using such a different and
bad plan compared to 9.1, when the data and the configuration are the
same?

regards,
- -- 
 Rafael Martinez Guerrero
 Center for Information Technology
 University of Oslo, Norway

 PGP Public Key: http://folk.uio.no/rafael/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)

iEYEARECAAYFAlIcbx8ACgkQBhuKQurGihReJgCcCiEfGQ0rZHcazlN3Ihb2PeCn
jOsAnjkh1M0j4r1DQJ4Xb1djZ+y4mji3
=Td8b
-----END PGP SIGNATURE-----


-- 
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 (8+ messages)  latest in thread

Message-ID: <521C6F1F.5070901@usit.uio.no>
Permalink:  ../521C6F1F.5070901@usit.uio.no/
Also on:    postgresql.org/message-id/521C6F1F.5070901@usit.uio.no

 · 

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: r.m.guerrero@usit.uio.no
  Subject: Re: SQL statement over 500% slower with 9.2 compared with 9.1
  In-Reply-To: <521C6F1F.5070901@usit.uio.no>

* 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