pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ryan Bradetich <ryan_bradetich@hp.com>
Cc: pgsql-sql@postgresql.org
Subject: RE: Use of index in 7.0 vs 6.5
Date: Thu, 25 May 2000 16:19:54 +0900
Message-ID: <000e01bfc619$9fa5f9c0$2801007e@tpf.co.jp> (raw)
In-Reply-To: <21530.959235278@sss.pgh.pa.us>

> -----Original Message-----
> From: pgsql-sql-owner@hub.org [mailto:pgsql-sql-owner@hub.org]On Behalf
> Of Tom Lane
> 

[snip]
 
> 
> This seems to point up (once again) the deficiency of assuming that
> the most-common value in the table is a good guide to the frequency
> of typical values.  You showed that host_id = 446 occurs in 2.8% of
> the rows in this table; a search for 446 very probably would be faster
> as a seqscan than as an indexscan (you might care to try it and see).
> But that's probably a statistical outlier that's not got much to do
> with the frequency of typical values in the table.
> 
> The only really good answer to this problem is to collect more-detailed
> statistics in VACUUM ANALYZE, which I hope to see us doing in a release
> or so.

For example we could count up distinct values for the first column of an
index by scanning its index relation.
 
> In the meantime I am wondering about deliberately skewing the
> cost model in favor of indexscans, because I sure haven't heard many
> complaints about erroneous selection of indexscans...
> 
> One way to put a thumb on the scales is to reduce the value of the SET
> variable random_page_cost.  The default value is 4.0, which seems to
> correspond more or less to reality, but reducing it to 3 or so would
> shift the planner pretty nicely in the direction of indexscans.
>

Or how about changing current fudge factor ?
For example,from 0.5 to 0.2 which is the fudge factor of attdisbursion
calculation. 

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp




view thread (18+ messages)  latest in thread

Message-ID: <000e01bfc619$9fa5f9c0$2801007e@tpf.co.jp>
Permalink:  ../000e01bfc619$9fa5f9c0$2801007e@tpf.co.jp/
Also on:    postgresql.org/message-id/000e01bfc619$9fa5f9c0$2801007e@tpf.co.jp

 · 

reply

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-sql@postgresql.org
  Cc: Inoue@tpf.co.jp, tgl@sss.pgh.pa.us, ryan_bradetich@hp.com
  Subject: Re: Use of index in 7.0 vs 6.5
  In-Reply-To: <000e01bfc619$9fa5f9c0$2801007e@tpf.co.jp>
  References: <21530.959235278@sss.pgh.pa.us> <000e01bfc619$9fa5f9c0$2801007e@tpf.co.jp>

* 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