X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2EB1B4758E6; Fri, 4 Apr 2003 14:26:20 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 6BBB2474E42; Fri, 4 Apr 2003 14:26:19 -0500 (EST) Received: from [216.135.165.74] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2942665; Fri, 04 Apr 2003 11:26:11 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Manfred Koizar Subject: Re: [SQL] can i make this sql query more efficiant? Date: Fri, 4 Apr 2003 11:26:14 -0800 User-Agent: KMail/1.4.3 Cc: "Tomasz Myrta" , Robert Treat , pgsql-sql@postgresql.org, pgsql-performance@postgresql.org References: <1049403724.13799.5473.camel@camel> <200304040816.01369.josh@agliodbs.com> In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200304041126.14530.josh@agliodbs.com> X-Spam-Status: No, hits=-32.4 required=5.0 tests=BAYES_01,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/63 X-Sequence-Number: 1569 Manfred, > I'd be honestly interested in the circumstances where you made that > observation. Hmmmm ... one of my database involves a "crosstab" converstion where there= =20 were 13 possible values, and the converted table is heavily indexed. For= =20 that case, I found using CASE statements to be slower. For your example, how do the statistics change if you increase the number o= f=20 levels to 15 and put an index on them? --=20 -Josh Berkus Aglio Database Solutions San Francisco