Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id C238B2E004D for ; Mon, 26 May 2008 19:49:39 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81685-02 for ; Mon, 26 May 2008 19:49:32 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.237]) by developer.postgresql.org (Postfix) with ESMTP id C5D832E003D for ; Mon, 26 May 2008 19:49:36 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so2522760rvf.43 for ; Mon, 26 May 2008 15:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=ZUnGFvJ4VrXYMXEt/NxhKbhhqPOnDddel5tIO2m55+w=; b=Uwptc6E7bGurZcqq87s2R2Krep7JE9ojCzO4smq066Xw6XMuflvLku/e9HXWsq8tyPrdF5pPvHGU2+DPI1Q/SGANZfu2GO6ZYLWSb3NSa/qg9ixGsJrMCGWWcVJ9JpbU4UqJgD0Uo1IYFXRhqaWWWdqwSL7mcR3HZskkqKslfaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=R0wr3Po21y+XmOqo4Aw8NtuSf2hyApZ2jlWBcdLQdXs8B1fEFOujCOsY0G7llIi48Jila1LGNxiAKfawoSf4AX8C+pgWj1/Z0OYcM82D7on19TGOyH2OIchauAeHysRZuodcsc9+GC1XeOiehW/ATobSyoJhDfao+l39m9BjLDE= Received: by 10.114.169.2 with SMTP id r2mr585510wae.76.1211842175375; Mon, 26 May 2008 15:49:35 -0700 (PDT) Received: by 10.114.56.5 with HTTP; Mon, 26 May 2008 15:49:35 -0700 (PDT) Message-ID: <82fa9e310805261549m2362fbe8sbf18789938fee833@mail.gmail.com> Date: Mon, 26 May 2008 15:49:35 -0700 From: mark To: pgsql-general@postgresql.org Subject: select query takes 13 seconds to run with index MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/951 X-Sequence-Number: 133350 Hi, is there anyway this can be made faster? id is the primary key, and there is an index on uid.. thanks EXPLAIN ANALYZE select * from pokes where uid = 578439028 order by id DESC limit 6; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=0.00..9329.02 rows=6 width=135) (actual time=13612.247..13612.247 rows=0 loops=1) -> Index Scan Backward using pokes_pkey on pokes (cost=0.00..5182270.69 rows=3333 width=135) (actual time=13612.245..13612.245 rows=0 loops=1) Filter: (uid = 578439028) Total runtime: 13612.369 ms (4 rows)