X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id DE3F09FB2CF for ; Tue, 19 Sep 2006 15:17:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 64863-03 for ; Tue, 19 Sep 2006 15:17:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8CAAF9FB2C4 for ; Tue, 19 Sep 2006 15:17:54 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k8JIHqua015196; Tue, 19 Sep 2006 14:17:52 -0400 (EDT) To: CG cc: pgsql-sql@postgresql.org Subject: Re: Nested loops are killing throughput In-reply-to: <20060919180506.16876.qmail@web37903.mail.mud.yahoo.com> References: <20060919180506.16876.qmail@web37903.mail.mud.yahoo.com> Comments: In-reply-to CG message dated "Tue, 19 Sep 2006 11:05:06 -0700" Date: Tue, 19 Sep 2006 14:17:52 -0400 Message-ID: <15195.1158689872@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.102 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/131 X-Sequence-Number: 26342 CG writes: > I'm still getting the nested loop for a join. > Nested Loop (cost=100000000.00..100013378.98 rows=2206 width=145) (actual time=46.743..18202.318 rows=2225 loops=1) > -> Index Scan using packet_user_idx on packet dp (cost=0.00..88.03 rows=2206 width=125) (actual time=42.263..124.519 rows=2225 loops=1) > Index Cond: ((username)::text = 'joeuser'::text) > -> Index Scan using packet_status_puuid_pkey on packet_status dps (cost=0.00..6.01 rows=1 width=20) (actual time=8.115..8.117 rows=1 loops=2225) > Index Cond: ("outer".packet_uuid = dps.packet_uuid) > Total runtime: 18205.880 ms If packet_status is large, that seems like a perfectly reasonable plan to me. If not ... what data type is packet_uuid? Is its equality op marked mergeable or hashable? regards, tom lane