Re: [PERFORM] Possible Performance Regression with Transitive Comparisons vs. Constants

2012-09-28 Thread Tom Lane
Shaun Thomas writes: > The first part of the question stands, though... Why isn't the optimizer > substituting these values? a.created_date should be exactly equivalent > to '2012-05-05', but it's clearly not being treated that way. No version of Postgres has ever substituted constants in the w

Re: [PERFORM] Possible Performance Regression with Transitive Comparisons vs. Constants

2012-09-28 Thread Shaun Thomas
On 09/28/2012 03:35 PM, Tom Lane wrote: 9.1.what? For me, 8.2.23 and 9.1.6 produce the same plan and just about the same runtime for your query 1. I withdraw that part of my question. I apparently didn't look closely enough at the actual output. I was basing the version assumption on the qu

Re: [PERFORM] Possible Performance Regression with Transitive Comparisons vs. Constants

2012-09-28 Thread Tom Lane
Shaun Thomas writes: > I ran into this while we were working on an upgrade project. We're > moving from 8.2 (don't ask) to 9.1, and started getting terrible > performance for some queries. I've managed to boil it down to a test case: 9.1.what? For me, 8.2.23 and 9.1.6 produce the same plan and

[PERFORM] Possible Performance Regression with Transitive Comparisons vs. Constants

2012-09-28 Thread Shaun Thomas
Hey guys, I ran into this while we were working on an upgrade project. We're moving from 8.2 (don't ask) to 9.1, and started getting terrible performance for some queries. I've managed to boil it down to a test case: create temp table my_foo as select a.id, '2012-01-01'::date + (random()*365)