Index-only scan and random_page_cost - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Index-only scan and random_page_cost
Date
Msg-id 97128c23-dca1-68ae-1961-e15e9acbdc81@garret.ru
Whole thread Raw
List pgsql-hackers
Hi hackers,

Right now cost of index-only scan is using `random_page_cost`.
Certainly for point selects we really have random access pattern, but 
queries like "select count(*) from hits"  access pattern is more or less 
sequential:
we are iterating through subsequent leaf B-Tree pages.  As far as 
default value of `random_page_cost`  is 4 times larger than `seq_page_cost`
it may force Postgres optimizer to choose sequential scan, while 
index-only scan is usually much faster in this case.
Can we do something here to provide more accurate cost estimation?





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: run pgindent on a regular basis / scripted manner
Next
From: Nitin Jadhav
Date:
Subject: Re: Fix GUC_NO_SHOW_ALL test scenario in 003_check_guc.pl