X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3270253541 for ; Wed, 6 Apr 2005 19:02:16 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43361-03 for ; Wed, 6 Apr 2005 18:02:05 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 277CB5349F for ; Wed, 6 Apr 2005 19:02:04 +0100 (BST) Received: by flake.decibel.org (Postfix, from userid 1001) id A717F153B1; Wed, 6 Apr 2005 13:02:04 -0500 (CDT) Date: Wed, 6 Apr 2005 13:02:04 -0500 From: "Jim C. Nasby" To: Ricardo Valen?a de Assis Cc: Bruno Wolff III , pgsql-admin@postgresql.org Subject: Re: delete to slow Message-ID: <20050406180204.GG93835@decibel.org> References: <006701c53ac8$014b27e0$1b00280a@ugf.br> <20050406173137.GA19739@wolff.to> <00e301c53ace$ab400260$1b00280a@ugf.br> <20050406175641.GF93835@decibel.org> <010101c53ad2$5a4d84a0$1b00280a@ugf.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <010101c53ad2$5a4d84a0$1b00280a@ugf.br> X-Operating-System: FreeBSD 4.11-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.8i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.021 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/84 X-Sequence-Number: 17097 On Wed, Apr 06, 2005 at 02:59:18PM -0300, Ricardo Valen?a de Assis wrote: > DATABASE=# explain delete from usuario where > usua_cd_usuario=backup.usua_cd_usuario; > QUERY PLAN > -------------------------------------------------------------------- > Hash Join (cost=5.71..644.15 rows=298 width=6) > Hash Cond: ("outer".usua_cd_usuario = "inner".usua_cd_usuario) > -> Seq Scan on usuario (cost=0.00..516.64 rows=23764 width=10) > -> Hash (cost=4.97..4.97 rows=297 width=4) > -> Seq Scan on backup (cost=0.00..4.97 rows=297 width=4) > (5 rows) > > DATABASE=# explain delete from usuario where usua_cd_usuario in (select > usua_cd_usuario from backup); > QUERY PLAN > -------------------------------------------------------------------- > Hash IN Join (cost=5.71..644.15 rows=298 width=6) > Hash Cond: ("outer".usua_cd_usuario = "inner".usua_cd_usuario) > -> Seq Scan on usuario (cost=0.00..516.64 rows=23764 width=10) > -> Hash (cost=4.97..4.97 rows=297 width=4) > -> Seq Scan on backup (cost=0.00..4.97 rows=297 width=4) > (5 rows) Well, neither of those should take very long at all. What's EXPLAIN ANALYZE show? -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"