Re: [HACKERS] BRIN cost estimate
От | Tom Lane |
---|---|
Тема | Re: [HACKERS] BRIN cost estimate |
Дата | |
Msg-id | 12378.1491493675@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [HACKERS] BRIN cost estimate (David Rowley <david.rowley@2ndquadrant.com>) |
Ответы |
Re: [HACKERS] BRIN cost estimate
|
Список | pgsql-hackers |
David Rowley <david.rowley@2ndquadrant.com> writes: > + *indexTotalCost += 0.1 * cpu_operator_cost * estimatedRanges * > + pagesPerRange; > This is trying to cost up the following code in bringetbitmap() > if (addrange) > { > BlockNumber pageno; > for (pageno = heapBlk; > pageno <= heapBlk + opaque->bo_pagesPerRange - 1; > pageno++) > { > MemoryContextSwitchTo(oldcxt); > tbm_add_page(tbm, pageno); > totalpages++; > MemoryContextSwitchTo(perRangeCxt); > } > I'm charging 0.1 * cpu_operator_cost for each loop we expect to > perform here. TBH, I think that code is in the noise. It doesn't involve any disk access, or catalog access, or user-defined function calls. I wouldn't bother trying to account for it. What you should be accounting for is the ensuing heap page accesses, but I assume that's done somewhere else. regards, tom lane
В списке pgsql-hackers по дате отправления: