Re: Why hash join instead of nested loop?

From: Ian Westmacott <ianw(at)intellivid(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Why hash join instead of nested loop?
Date: 2005-08-09 12:15:56
Message-ID: 1123589756.15206.4.camel@spectre.intellivid.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, 2005-08-08 at 20:58, Tom Lane wrote:
> I'd be interested to see results from other people using 7.4.* too.

7.4.8:

QUERY
PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------
Hash Join (cost=4.83..5.91 rows=1 width=14) (actual time=0.122..0.126
rows=1 loops=1)
Hash Cond: ("outer".id = "inner".obj2)
-> Seq Scan on rtmessagestate (cost=0.00..1.05 rows=5 width=14)
(actual time=0.003..0.006 rows=5 loops=1)
-> Hash (cost=4.83..4.83 rows=1 width=4) (actual time=0.021..0.021
rows=0 loops=1)
-> Index Scan using connection_regid_obj1_index on connection
(cost=0.00..4.83 rows=1 width=4) (actual time=0.013..0.015 rows=1
loops=1)
Index Cond: ((connection_registry_id = 40105) AND (obj1 =
73582))
Total runtime: 0.198 ms

7.4.2:


QUERY
PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------
Hash Join (cost=4.83..5.91 rows=1 width=14) (actual time=0.577..0.600
rows=1 loops=1)
Hash Cond: ("outer".id = "inner".obj2)
-> Seq Scan on rtmessagestate (cost=0.00..1.05 rows=5 width=14)
(actual time=0.006..0.023 rows=5 loops=1)
-> Hash (cost=4.83..4.83 rows=1 width=4) (actual time=0.032..0.032
rows=0 loops=1)
-> Index Scan using connection_regid_obj1_index on connection
(cost=0.00..4.83 rows=1 width=4) (actual time=0.016..0.020 rows=1
loops=1)
Index Cond: ((connection_registry_id = 40105) AND (obj1 =
73582))
Total runtime: 0.697 ms

--Ian

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-08-09 14:33:37 Re: Why hash join instead of nested loop?
Previous Message Michael Fuhr 2005-08-09 05:11:48 Re: Why hash join instead of nested loop?