X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id AD9869F9AD3 for ; Wed, 3 May 2006 12:20:43 -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 03223-03 for ; Wed, 3 May 2006 12:20:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from globalrelay.com (mail1.globalrelay.com [216.18.71.77]) by postgresql.org (Postfix) with ESMTP id 5B4119F96B6 for ; Wed, 3 May 2006 12:20:36 -0300 (ADT) X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway X-GR-Acctd: YES Received: from [67.90.96.2] (HELO DaveEMachine) by globalrelay.com (CommuniGate Pro SMTP 4.2.3) with ESMTP id 89293437; Wed, 03 May 2006 08:20:35 -0700 From: "Dave Dutcher" To: "'Mario Splivalo'" , Subject: Re: Lot'sa joins - performance tip-up, please? Date: Wed, 3 May 2006 10:20:35 -0500 Message-ID: <003001c66ec5$205a0160$8300a8c0@tridecap.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <1146533274.14006.11.camel@localhost.localdomain> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/85 X-Sequence-Number: 18872 > -> Nested Loop (cost=0.00..176144.30 rows=57925 width=26) > (actual time=68.322..529472.026 rows=57925 loops=1) > -> Seq Scan on ticketing_codes_played > (cost=0.00..863.25 rows=57925 width=8) (actual time=0.042..473.881 > rows=57925 loops=1) > -> Index Scan using ticketing_codes_pk on > ticketing_codes (cost=0.00..3.01 rows=1 width=18) (actual > time=9.102..9.108 rows=1 loops=57925) > Index Cond: (ticketing_codes.code_id = > "outer".code_id) > Total runtime: 542000.093 ms > (27 rows) > > > I'll be more than happy to provide any additional information > that I may > be able to gather. I'd be most happy if someone would scream something > like "four joins, smells like a poor design" because design > is poor, but > the system is in production, and I have to bare with it. It looks like that nested loop which is joining ticketing_codes_played to ticketing_codes is the slow part. I'm curious how many rows are in the ticketing_codes table? Four or five joins does not seem like a lot to me, but it can be slow if you are joining big tables with other big tables.