Re: Query > 1000× slowdown after adding datetime comparison - Mailing list pgsql-performance

From twoflower
Subject Re: Query > 1000× slowdown after adding datetime comparison
Date
Msg-id 1441048763332-5864080.post@n5.nabble.com
Whole thread Raw
In response to Re: Query > 1000× slowdown after adding datetime comparison  (twoflower <standa.kurik@gmail.com>)
Responses Re: [PERFORM] Re: Query > 1000× slowdown after adding datetime comparison
List pgsql-performance
And another thing which comes out as a little surprising to me - if I replace
the *date_last_updated* condition with another one, say *doc.documenttype =
4*, the query finishes immediately. *documenttype* is an unindexed integer
column.

Here's the query plan:

<http://postgresql.nabble.com/file/n5864080/qp3.png>

What's so special about that *date_last_updated* condition that makes it so
slow to use? Is it because it involves the *date()* function call that it
makes it difficult for the planner to guess the data distribution in the
DOCUMENT table?



--
View this message in context:
http://postgresql.nabble.com/Query-1-000-000-slowdown-after-adding-datetime-comparison-tp5864045p5864080.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.


pgsql-performance by date:

Previous
From: twoflower
Date:
Subject: Re: Query > 1000× slowdown after adding datetime comparison
Next
From: "David G. Johnston"
Date:
Subject: Re: [PERFORM] Re: Query > 1000× slowdown after adding datetime comparison