X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F267ED1B25F for ; Fri, 11 Jun 2004 15:01:07 -0300 (ADT) 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 37859-10 for ; Fri, 11 Jun 2004 18:00:16 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id D78CCD1B1BB for ; Fri, 11 Jun 2004 14:59:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5BHxgMe016730; Fri, 11 Jun 2004 13:59:43 -0400 (EDT) To: Nick Trainor Cc: pgsql-performance@postgresql.org Subject: Re: ORDER BY user defined function performance issues In-reply-to: <20040611110837.E5F5215D888@ns.trainorthornton.co.uk> References: <20040611110837.E5F5215D888@ns.trainorthornton.co.uk> Comments: In-reply-to Nick Trainor message dated "Fri, 11 Jun 2004 12:14:55 +0100" Date: Fri, 11 Jun 2004 13:59:42 -0400 Message-ID: <16729.1086976782@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/131 X-Sequence-Number: 7189 Nick Trainor writes: > What am I missing here? The ORDER BY query has to evaluate the function at *every* row of the table before it can sort. The other query was only evaluating the function at twenty rows. regards, tom lane