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@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance