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

2015-05-04 Thread Bernd Helmle
--On 1. Mai 2015 11:30:51 -0700 Tom Lane t...@sss.pgh.pa.us 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

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

2015-05-01 Thread Tom Lane
Bernd Helmle maili...@oopsware.de 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

[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;

[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 =

Re: [HACKERS] cost_index()

2014-10-27 Thread Tom Lane
Teodor Sigaev teo...@sigaev.ru 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

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: