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

From twoflower
Subject Re: Re: Query > 1000× slowdown after adding datetime comparison
Date
Msg-id 1441050416677-5864088.post@n5.nabble.com
Whole thread Raw
In response to Re: [PERFORM] Re: Query > 1000× slowdown after adding datetime comparison  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: [PERFORM] Re: Query > 1000× slowdown after adding datetime comparison  (Stefan Keller <sfkeller@gmail.com>)
List pgsql-performance
David G Johnston wrote
> What happens if you pre-compute the date condition and hard code it?

I created a new boolean column and filled it for every row in DOCUMENT with
*(doc.date_last_updated >= date(now() - '171:00:00'::interval))*, reanalyzed
the table and modified the query to just compare this column to TRUE. I
expected this to be very fast, considering that a (to me, anyway) similar
query also containing a constant value comparison finishes immediately.
However, the query is running now for 4 minutes already. That's really
interesting.



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


pgsql-performance by date:

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