X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 86F7A9DCC43 for ; Mon, 28 Nov 2005 19:47:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72619-02 for ; Mon, 28 Nov 2005 19:47:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from presinet.com (presinet.com [209.53.156.1]) by postgresql.org (Postfix) with ESMTP id BE2319DCC33 for ; Mon, 28 Nov 2005 19:47:07 -0400 (AST) Received: from [10.10.1.151] ([10.10.1.151]) by presinet.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 28 Nov 2005 15:44:25 -0800 Message-ID: <438B96C6.4090902@PresiNET.com> Date: Mon, 28 Nov 2005 15:46:14 -0800 From: Bricklen Anderson User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Gagnon CC: pgsql-performance@postgresql.org Subject: Re: Please help with this explain analyse... References: <438B958B.3010602@siunik.com> In-Reply-To: <438B958B.3010602@siunik.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Nov 2005 23:44:25.0750 (UTC) FILETIME=[AA6C4360:01C5F475] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/543 X-Sequence-Number: 15800 David Gagnon wrote: > " -> Index Scan using cr_pk on cr (cost=0.00..6.02 rows=1 > width=828) (actual time=0.073..0.077 rows=1 loops=13587)" > " Index Cond: (((cr.crypnum)::text = 'M'::text) AND > (cr.crnum = "outer".cscrnum))" > " Filter: ((crdate + '00:00:00'::interval) <= > '2005-01-28 00:00:00'::timestamp without time zone)" > " -> Index Scan using rr_pk on rr (cost=0.00..5.99 rows=1 > width=5637) (actual time=0.062..0.069 rows=1 loops=8335)" > " Index Cond: (("outer".crrrnum)::text = (rr.rrnum)::text)" > " -> Index Scan using yr_idx1 on yr (cost=0.00..5.99 rows=1 > width=926) (actual time=0.127..17.379 rows=1154 loops=8335)" Your loops are what is causing the time spent. eg. "actual time=0.127..17.379 rows=1154 loops=8335)" == 8335*(17.379-0.127)/1000=>143 secs (if my math is correct). -- _______________________________ This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately. _______________________________