Re: BUG #3826: Very Slow Execution of examplequery (wrong plan?) - Mailing list pgsql-bugs

From Gregory Stark
Subject Re: BUG #3826: Very Slow Execution of examplequery (wrong plan?)
Date
Msg-id 87tzmfkb35.fsf@oxford.xeocode.com
Whole thread Raw
In response to BUG #3826: Very Slow Execution of examplequery (wrong plan?)  ("Alexander Steffens" <mail@a-st.de>)
Responses Re: BUG #3826: Very Slow Execution of examplequery (wrong plan?)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
"Alexander Steffens" <mail@a-st.de> writes:

> Hello, I have found an Query (with data)
> that need to execute on MS-SQL 2005 < 9sec,
> on Postgresql I will stop it now after more than 30 mins:

> insert into t1
> select distinct (t1.a + t2.a)*2
> from t1,t2
> where not exists (
>  select * from t1  tt where tt.a = (t1.a + t2.a)*2
> )

What plan does MS-SQL use to complete this? I wonder whether it's producing
the same answer Postgres is.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's PostGIS support!

pgsql-bugs by date:

Previous
From: "Alexander Steffens"
Date:
Subject: BUG #3826: Very Slow Execution of examplequery (wrong plan?)
Next
From: Tom Lane
Date:
Subject: Re: BUG #3826: Very Slow Execution of examplequery (wrong plan?)