Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by postgresql.org (Postfix) with ESMTP id 08A6B475165 for ; Mon, 29 Jul 2002 04:20:09 -0400 (EDT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id g6T8K1329994; Mon, 29 Jul 2002 10:20:01 +0200 Received: from dell-01.mm.eutelsat.org (IDENT:root@dell-01.mm.eutelsat.org [194.214.173.17]) by nts-03.mm.eutelsat.org (8.9.3/8.8.7) with ESMTP id JAA05022; Mon, 29 Jul 2002 09:13:35 +0200 Received: from GMENDOLA2 (gmendola2.mm.eutelsat.org [194.214.173.26]) by dell-01.mm.eutelsat.org (8.11.2/8.8.7) with SMTP id g6T8JVc16420; Mon, 29 Jul 2002 10:19:31 +0200 Message-ID: <016e01c236d9$00515ad0$1aadd6c2@GMENDOLA2> From: "Gaetano Mendola" To: "Tom Lane" Cc: References: <014c01c2361e$62a53c30$1aadd6c2@GMENDOLA2> <11600.1027876922@sss.pgh.pa.us> Subject: Re: cpu_tuple_cost WRONG -> After an "analyze" or "vacuum full" indexes are not used anymore!!! Date: Mon, 29 Jul 2002 10:21:55 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200207/391 X-Sequence-Number: 5075 From: "Tom Lane" > 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