From: mark <markkicks@gmail.com>
To: pgsql-general@postgresql.org
Subject: select query takes 13 seconds to run with index
Date: Mon, 26 May 2008 15:49:35 -0700
Message-ID: <82fa9e310805261549m2362fbe8sbf18789938fee833@mail.gmail.com> (raw)
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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: markkicks@gmail.com, pgsql-general@postgresql.org
Subject: Re: select query takes 13 seconds to run with index
In-Reply-To: <82fa9e310805261549m2362fbe8sbf18789938fee833@mail.gmail.com>
References: <82fa9e310805261549m2362fbe8sbf18789938fee833@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox