Re: abou the cost estimation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ljguo_1234 <ljguo_1234(at)sina(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: abou the cost estimation
Date: 2002-09-06 13:01:05
Message-ID: 16203.1031317265@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ljguo_1234 <ljguo_1234(at)sina(dot)com> writes:
> I have read the source code /cvsroot/pgsql/src/backend/optimizer/path/costsize.c and there is a function cost_sort(...). I think the code in 464 to 465 lines must be changed to:
> startup_cost += npageaccesses *
> (1.0 + cost_nonsequential_access(1)) * 0.5;

That would be wrong. Note the definition of cost_nonsequential_access:

* Estimate the cost of accessing one page at random from a relation
* (or sort temp file) of the given size in pages.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Copeland 2002-09-06 13:01:27 Re: Inheritance
Previous Message Hannu Krosing 2002-09-06 12:53:37 Re: Inheritance