pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: pgsql-performance@postgresql.org
Subject: Re: Query > 1000× slowdown after adding datetime comparison
Date: Mon, 31 Aug 2015 18:19:35 +0200
Message-ID: <55E47E97.1090202@2ndquadrant.com> (raw)
In-Reply-To: <1441037351126-5864045.post@n5.nabble.com>
References: <1441037351126-5864045.post@n5.nabble.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>



On 08/31/2015 06:09 PM, twoflower wrote:
> I have the following three tables:
...
> This is the query plan:
>
> <http://postgresql.nabble.com/file/n5864045/qp1.png;
>
> If I remove the WHERE condition, it returns immediately.
>
> Am I doing something obviously wrong?

Please share explain plans for both the slow and the fast query. That 
makes it easier to spot the difference, and possibly identify the cause.

Also, what PostgreSQL version is this, and what are "basic" config 
parameters (shared buffers, work mem)?

regards

--
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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



Message-ID: <55E47E97.1090202@2ndquadrant.com>
Permalink:  ../55E47E97.1090202@2ndquadrant.com/
Also on:    postgresql.org/message-id/55E47E97.1090202@2ndquadrant.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com
  Subject: Re: Query > 1000× slowdown after adding datetime comparison
  In-Reply-To: <55E47E97.1090202@2ndquadrant.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