From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: Chris Miles <chris@psychofx.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: This table won't use INDEX until I DUMP/RESTORE it ?
Date: Thu, 21 Aug 2003 18:05:07 -0400
Message-ID: <29274.1061503507@sss.pgh.pa.us> (raw)
In-Reply-To: <20030821101658.I51705-100000@megazone.bigpanda.com>
References: <20030821101658.I51705-100000@megazone.bigpanda.com>
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> That was more to get its idea for the cost of the index scan.
> As a short term thing, if you havent played with random_page_cost,
> I'd suggest lowering it from the default 4 to say 3 or 2 and see
> what plan it gives you.
Given the closeness of the two cost estimates, random_page_cost
shouldn't need to be moved much at all to flip the plan choice to
indexscan for this particular query. You might want to move it more
so that the ratio of the estimates approximates reality, but I advise
caution on that, or at least caution on using this example as the
test case. There's a fairly large misestimate of the number of returned
rows in there too, and so if you use this case you'll be conflating
the effects of that misestimate with the effects of random_page_cost
being wrong for your environment.
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 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-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, sszabo@megazone.bigpanda.com, chris@psychofx.com
Subject: Re: This table won't use INDEX until I DUMP/RESTORE it ?
In-Reply-To: <29274.1061503507@sss.pgh.pa.us>
References: <20030821101658.I51705-100000@megazone.bigpanda.com> <29274.1061503507@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