X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 6EE599FB28C for ; Tue, 15 Aug 2006 18:13:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 77985-08 for ; Tue, 15 Aug 2006 21:13:04 +0000 (UTC) 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 78BE89FB274 for ; Tue, 15 Aug 2006 18:13:04 -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 k7FLD2XK020385; Tue, 15 Aug 2006 17:13:02 -0400 (EDT) To: sebaioni-postgresql@yahoo.com.ar cc: Performance PostgreSQL Subject: Re: Inner Join of the same table In-reply-to: <20060815185335.14227.qmail@web36114.mail.mud.yahoo.com> References: <20060815185335.14227.qmail@web36114.mail.mud.yahoo.com> Comments: In-reply-to =?iso-8859-1?q?Sebasti=E1n=20Baioni?= message dated "Tue, 15 Aug 2006 18:53:35 -0000" Date: Tue, 15 Aug 2006 17:13:02 -0400 Message-ID: <20384.1155676382@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/253 X-Sequence-Number: 20438 =?iso-8859-1?q?Sebasti=E1n=20Baioni?= writes: > 8 -> GroupAggregate (cost=0.00..37348395.05 rows=3951 width=25) (actual > time=130.000..2629617.000 rows=254576 loops=1) > 9 -> Index Scan using uesapt001 on APORTES (cost=0.00..37301678.64 > rows=9339331 width=25) (actual time=110.000..2520690.000 rows=9335892 loops=1) Given the relatively small estimated number of group rows, I'd have expected the thing to use a seqscan and HashAggregate for this part. Do you have enable_hashagg turned off for some reason? Or enable_seqscan? regards, tom lane