X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B3760D1E128 for ; Mon, 15 Mar 2004 17:20:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 05539-03 for ; Mon, 15 Mar 2004 13:20:51 -0400 (AST) Received: from smtp.istop.com (dci.doncaster.on.ca [66.11.168.194]) by svr1.postgresql.org (Postfix) with ESMTP id 60ADAD1E155 for ; Mon, 15 Mar 2004 13:20:50 -0400 (AST) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by smtp.istop.com (Postfix) with ESMTP id EF02917C316; Mon, 15 Mar 2004 12:20:49 -0500 (EST) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1B2vlh-0006WA-00; Mon, 15 Mar 2004 12:20:49 -0500 To: Arjen van der Meijden Cc: pgsql-performance@postgresql.org Subject: Re: Large CASE-statement is pretty slow? References: <4054B36C.8030306@vulcanus.its.tudelft.nl> <25013.1079298580@sss.pgh.pa.us> <4054E8ED.3090200@vulcanus.its.tudelft.nl> In-Reply-To: <4054E8ED.3090200@vulcanus.its.tudelft.nl> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 15 Mar 2004 12:20:49 -0500 Message-ID: <87smga2fim.fsf@stark.xeocode.com> Lines: 13 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/195 X-Sequence-Number: 6051 Arjen van der Meijden writes: > Well, I have discarded this type of query as "too inefficient" and found a > better way Loading the mapping into a table with an index and doing an update using "from" to do a join seems likely to end up being the most efficient method. Postgres would probably not even bother with the index and do a hash join. -- greg