Re: query faster using LEFT OUTER join? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: query faster using LEFT OUTER join?
Date
Msg-id 45616764.1040902@archonet.com
Whole thread Raw
In response to query faster using LEFT OUTER join?  (Drew <drewmwilson@fastmail.fm>)
List pgsql-sql
Drew wrote:
> I have a planner question about a multi-join query, where if I rewrite 
> the query excluding the table that is left joined to the other tables my 
> query speed increases by 75%.

> Here's the plan for the first query (using 8.2b3)
>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

> 
> HashAggregate  (cost=3223.17..3223.41 rows=19 width=18) (actual 
> time=34.913..34.978 rows=122 loops=1)

> And here's the plan for the second query without the first LEFT OUTER 
> join (using 8.2b3)
>
------------------------------------------------------------------------------------------------------------------------------------------------------------------------

> 
> HashAggregate  (cost=8927.87..8936.89 rows=721 width=18) (actual 
> time=39.484..39.551 rows=122 loops=1)

Query1: 34.9ms
Query2: 39.5ms

I'm not seeing a huge difference here. Are these the right EXPLAINs?

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Chris Tennant
Date:
Subject: Re: planner used functional index in 7.3.6, now does a seq
Next
From: "Rajesh Kumar Mallah"
Date:
Subject: tsvector_eq appears to be inconsistent.