From: John A Meinel <john@arbash-meinel.com>
To: Yves Vindevogel <yves.vindevogel@implements.be>
Cc: pgsql-performance@postgresql.org
Subject: Re: Limit clause not using index
Date: Tue, 21 Jun 2005 10:14:24 -0500
Message-ID: <42B82ED0.1010009@arbash-meinel.com> (raw)
In-Reply-To: <7e514564b9a159480857de53cc1764fd@implements.be>
References: <d0da86521cd54473cac40df63bb14546@implements.be>
<42B8275C.8040300@arbash-meinel.com>
<7e514564b9a159480857de53cc1764fd@implements.be>
Yves Vindevogel wrote:
> rvponp=# explain analyze select * from tblPrintjobs order by
> loginuser, desceventdate, desceventtime ;
> QUERY PLAN
> --------------------------------------------------------------------------------------------------------------------------------
>
> Sort (cost=345699.06..347256.49 rows=622972 width=203) (actual
> time=259438.952..268885.586 rows=622972 loops=1)
> Sort Key: loginuser, desceventdate, desceventtime
> -> Seq Scan on tblprintjobs (cost=0.00..25596.72 rows=622972
> width=203) (actual time=21.155..8713.810 rows=622972 loops=1)
> Total runtime: 271583.422 ms
> (4 rows)
Can you post it with the limit? I realize the query takes a long time,
but that is the more important query to look at.
Also, just as a test, if you can, try dropping most of the indexes
except for the important one. It might be that the planner is having a
hard time because there are too many permutations to try.
I believe if you drop the indexes inside a transaction, they will still
be there for other queries, and if you rollback instead of commit, you
won't lose anything.
BEGIN;
DROP INDEX ...
EXPLAIN ANALYZE SELECT *...
ROLLBACK;
John
=:->
Attachments:
signature.asc (application/pgp-signature, 252B) download
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: john@arbash-meinel.com, yves.vindevogel@implements.be
Subject: Re: Limit clause not using index
In-Reply-To: <42B82ED0.1010009@arbash-meinel.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