Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 71705634987 for ; Thu, 4 Feb 2010 05:09:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06935-06 for ; Thu, 4 Feb 2010 09:09:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f201.google.com (mail-pz0-f201.google.com [209.85.222.201]) by mail.postgresql.org (Postfix) with ESMTP id DA4E26346E8 for ; Thu, 4 Feb 2010 05:09:12 -0400 (AST) Received: by pzk39 with SMTP id 39so2415309pzk.15 for ; Thu, 04 Feb 2010 01:09:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.151.31 with SMTP id y31mr572545wfd.107.1265274551148; Thu, 04 Feb 2010 01:09:11 -0800 (PST) In-Reply-To: <2f4958ff1002040028j29e907c6l47e1f5efe83b667d@mail.gmail.com> References: <603c8f071002031905w51dbea37y148284ea6546feda@mail.gmail.com> <2f4958ff1002040028j29e907c6l47e1f5efe83b667d@mail.gmail.com> Date: Thu, 4 Feb 2010 04:09:11 -0500 Message-ID: Subject: Re: Slow query: table iteration (8.3) From: Glenn Maynard To: pgsql-performance@postgresql.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 201002/81 X-Sequence-Number: 37502 2010/2/4 Grzegorz Ja=C5=9Bkiewicz : > isn't that possible with window functions and cte ? > rank, and limit ? It is, but again I tried that when I originally designed this and I think it ended up using seq scans, or at least being slow for some reason or other. But I'll be dropping this db into 8.4 soon to see if it helps anything, and I'll check again (and if it's still slow I'll post more details). It's been a while and I might just have been doing something wrong. --=20 Glenn Maynard