Re: [HACKERS] cost_index() and path row estimate.

2015-05-04 Thread Bernd Helmle
--On 1. Mai 2015 11:30:51 -0700 Tom Lane wrote: > No. The non-parameterized paths for a given relation must all have the > same rowcount estimates; otherwise the path comparison logic fails > fundamentally. Another way to look at it is that every correct path > will yield the same number of r

Re: [HACKERS] cost_index() and path row estimate.

2015-05-01 Thread Tom Lane
Bernd Helmle writes: > While looking into a customer performance problem, i saw this in > costsize.c, cost_index() (9.3.6, but it looks the same in HEAD): > ... > What i'm wondering is the else branch, where the baserel row estimate is > assigned to the > IndexPath. However, it occurs to me that i

[HACKERS] cost_index() and path row estimate.

2015-04-30 Thread Bernd Helmle
While looking into a customer performance problem, i saw this in costsize.c, cost_index() (9.3.6, but it looks the same in HEAD): /* Mark the path with the correct row estimate */ if (path->path.param_info) { path->path.rows = path->path.param_info->ppi_rows

Re: [HACKERS] cost_index()

2014-10-27 Thread Teodor Sigaev
No. Costs for touching the index were computed by the amcostestimate function; this code is solely about estimating costs for touching the heap. I see. Thank you. -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW:

Re: [HACKERS] cost_index()

2014-10-27 Thread Tom Lane
Teodor Sigaev writes: > if (indexonly) > pages_fetched = ceil(pages_fetched * (1.0 - > baserel->allvisfrac)); > As I understand the code, index_pages_fetched() returns summary of page's > read > for index and heap together. No. Costs for touching the index were computed

[HACKERS] cost_index()

2014-10-27 Thread Teodor Sigaev
Hi! Some fragment of code (src/backend/optimizer/path/costsize.c, lineno ~400): /* * Normal case: apply the Mackert and Lohman formula, and then * interpolate between that and the correlation-derived result. */ pages_fetched = index_pages_fetched(tuples_