pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <gmendola@mm.eutelsat.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!!
Date: Mon, 29 Jul 2002 10:18:37 +0200
Message-ID: <016101c236d8$89eb4bd0$1aadd6c2@GMENDOLA2> (raw)
References: <014c01c2361e$62a53c30$1aadd6c2@GMENDOLA2>
	<11600.1027876922@sss.pgh.pa.us>

From: "Tom Lane" <tgl@sss.pgh.pa.us>
> A saner way of tweaking the index-vs-seqscan costs is to reduce
> random_page_cost a little --- the default is 4.0 which may be on the
> high side.  (But don't push it below 1.0.)


So I tried:

# explain select * from to_del where col2 = 30;
NOTICE:  QUERY PLAN:

Seq Scan on to_del  (cost=0.00..8281.25 rows=4443 width=8)


for obtain an index scan I set random_page_cost = 2.8;
with 2.9 the choose was still the sequenzial scan.

# set random_page_cost = 2.8;
SET VARIABLE
#  explain select * from to_del where col2 = 30;
NOTICE:  QUERY PLAN:

Index Scan using idx_col2 on to_del  (cost=0.00..7953.95 rows=4443 width=8)

EXPLAIN


4.0 -> 2.8 is not so a little or not ?

Ciao
Gaetano




view thread (4+ messages)  latest in thread

Message-ID: <016101c236d8$89eb4bd0$1aadd6c2@GMENDOLA2>
Permalink:  ../016101c236d8$89eb4bd0$1aadd6c2@GMENDOLA2/
Also on:    postgresql.org/message-id/016101c236d8$89eb4bd0$1aadd6c2@GMENDOLA2

 · 

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-admin@postgresql.org
  Cc: gmendola@mm.eutelsat.org, tgl@sss.pgh.pa.us
  Subject: Re: cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!!
  In-Reply-To: <016101c236d8$89eb4bd0$1aadd6c2@GMENDOLA2>
  References: <014c01c2361e$62a53c30$1aadd6c2@GMENDOLA2> <11600.1027876922@sss.pgh.pa.us> <016101c236d8$89eb4bd0$1aadd6c2@GMENDOLA2>

* 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