Received: from palrel3.hp.com (palrel3.hp.com [156.153.255.226]) by hub.org (8.9.3/8.9.3) with ESMTP id TAA86194 for ; Thu, 25 May 2000 19:40:38 -0400 (EDT) (envelope-from ryan_bradetich@hp.com) Received: from hpbs5000.boi.hp.com (hpbs5000.boi.hp.com [15.56.8.201]) by palrel3.hp.com (Postfix) with ESMTP id BF159E15; Thu, 25 May 2000 16:40:36 -0700 (PDT) Received: from hp.com (rbrad@hpb50023.boise.itc.hp.com [15.62.176.50]) by hpbs5000.boi.hp.com with ESMTP (8.8.6 (PHNE_17135)/8.7.3 TIS 5.0.1) id RAA01738; Thu, 25 May 2000 17:40:36 -0600 (MDT) Message-ID: <392DB9F3.2907B731@hp.com> Date: Thu, 25 May 2000 17:40:35 -0600 From: Ryan Bradetich X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.3.99-pre3 i686) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane Cc: Hiroshi Inoue , pgsql-sql@postgresql.org Subject: Re: Use of index in 7.0 vs 6.5 References: <000e01bfc619$9fa5f9c0$2801007e@tpf.co.jp> <22559.959265549@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200005/148 Tom Lane wrote: > "Hiroshi Inoue" writes: > >> 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. This worked great! Is their a place I can change the default to 3? I do not want to change all the scripts to include this :) > > Or how about changing current fudge factor ? > > For example,from 0.5 to 0.2 which is the fudge factor of attdisbursion > > calculation. > > Yes, that's another way --- and probably more defensible than changing > random_page_cost, now that I think about it. Unfortunately it's a > hardwired constant and so not as easily experimented with :-(. > > regards, tom lane Can you give me more information about this? I do not have a problem re-compiling the database and performing more testing if you would like. Tom, To answer your question in a previous post: Since you find that in reality the indexscan method is very quick, I'm guessing that there are actually fairly few tuples matching host_id = 404. Could you run a quick "select count(*)" to check? procman=# select count(*) from medusa where host_id = 404; count ------- 680 (1 row) procman=# select count(catagory) from medusa where host_id = 404 and catagory like 'A%'; count ------- 4 (1 row) Thanks again everyone for all the help! Now that I am finished with school for the semester, I should have time to make contributions again ... :) Ryan