X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 553F58B9BD0 for ; Fri, 4 Feb 2005 21:33:34 +0000 (GMT) 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 48468-06 for ; Fri, 4 Feb 2005 21:33:23 +0000 (GMT) Received: from boutiquenumerique.com (boutiquenumerique.com [82.67.9.10]) by svr1.postgresql.org (Postfix) with ESMTP id E50758B9F61 for ; Fri, 4 Feb 2005 21:33:23 +0000 (GMT) Received: (qmail 1855 invoked from network); 4 Feb 2005 22:33:45 +0100 Received: from unknown (HELO musicbox) (boutiquenumerique-lists@192.168.0.2) by boutiquenumerique.com with SMTP; 4 Feb 2005 22:33:45 +0100 To: "Don Drake" , "Michael Glaesemann" Cc: pgsql-sql@postgresql.org Subject: Re: Determining Rank References: <6c21003b05020319061f8bce45@mail.gmail.com> <6c21003b05020413186eb2d41f@mail.gmail.com> Message-ID: From: PFC Organization: =?iso-8859-15?Q?La_Boutique_Num=E9rique?= Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Fri, 04 Feb 2005 22:36:12 +0100 In-Reply-To: <6c21003b05020413186eb2d41f@mail.gmail.com> User-Agent: Opera M2/7.54 (Linux, build 751) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/92 X-Sequence-Number: 20203 > Michael, > > That's an excellent solution, but on my table, the explain plan sucks > and the query time is over 3 minutes when implemented. Is there a > simple way to get a row_num without using a temporary sequence? > > Thanks for your help. > > -Don Make your query a set returning function which iterates over the query results and returns a number as well ?