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

From Stefan Keller
Subject Re: [PERFORM] Re: Query > 1000× slowdown after adding datetime comparison
Date
Msg-id CAFcOn2_1tknJ95JceZY1ikP1OURwgwuRFSQX21SJTLFF+ZzdRA@mail.gmail.com
Whole thread Raw
In response to Re: Re: Query > 1000× slowdown after adding datetime comparison  (twoflower <standa.kurik@gmail.com>)
Responses Re: Re: Query > 1000× slowdown after adding datetime comparison  (twoflower <standa.kurik@gmail.com>)
List pgsql-performance
So, if I'm understanding you correctly, we're talking solely about
following clause in the query you gave initially:

WHERE doc.date_last_updated >= date(now() - '171:00:00'::interval)
which initially was
WHERE documenttype = 4
and now is being replaced by a temporary (I'd say derived) column
WHERE updated
?

In any case - I have to go - but run http://explain.depesz.com/ and
give a weblink to the explain plans of your queries.

-S.


2015-08-31 22:30 GMT+02:00 twoflower <standa.kurik@gmail.com>:
> I did not. I wanted to compare this query to the one I tried before, having
> *documenttype = 4* as the sole condition. That one was very fast and the
> *documenttype* was not indexed either.
>
> But this query, using the new temporary column, still runs, after 48
> minutes...
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/Query-1-000-000-slowdown-after-adding-datetime-comparison-tp5864045p5864101.html
> Sent from the PostgreSQL - performance mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance


pgsql-performance by date:

Previous
From: twoflower
Date:
Subject: Re: Re: Query > 1000× slowdown after adding datetime comparison
Next
From: twoflower
Date:
Subject: Re: Re: Query > 1000× slowdown after adding datetime comparison