From: Tom Lane <tgl@sss.pgh.pa.us>
To: Francisco Reyes <lists@natserv.com>
Cc: John Meinel <john@johnmeinel.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: why my query is not using index??
Date: Tue, 12 Oct 2004 01:26:53 -0400
Message-ID: <28283.1097558813@sss.pgh.pa.us> (raw)
In-Reply-To: <20041012005231.U98867@zoraida.natserv.net>
References: <41639F3C.4050103@siche.net>
<200410111425.02671.vygen@gmx.de>
<20041011163756.M97379@zoraida.natserv.net>
<416B217D.9090000@johnmeinel.com>
<20041012005231.U98867@zoraida.natserv.net>
Francisco Reyes <lists@natserv.com> writes:
> With explain analyze I have with sequential scan on
> Sort (cost=382.01..382.15 rows=56 width=196)
> (actual time=64.346..64.469 rows=24 loops=1)
> And with seqscan off
> Sort (cost=490.82..490.96 rows=56 width=196)
> (actual time=56.668..56.789 rows=24 loops=1)
> So I guess that for this particular query I am better off setting the
> seqscan off.
For that kind of margin, you'd be a fool to do any such thing.
You might want to look at making some adjustment to random_page_cost
to bring the estimated costs in line with reality (though I'd counsel
taking more than one example into account while you tweak it). But
setting seqscan off as a production setting is just a recipe for
shooting yourself in the foot.
regards, tom lane
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: tgl@sss.pgh.pa.us, lists@natserv.com, john@johnmeinel.com
Subject: Re: why my query is not using index??
In-Reply-To: <28283.1097558813@sss.pgh.pa.us>
* 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