On Tue, Feb 12, 2019 at 4:17 PM Tom Lane <t...@sss.pgh.pa.us> wrote: > Jeff Janes <jeff.ja...@gmail.com> writes: > > In order for bloom (or any other users of CREATE ACCESS METHOD, if there > > are any) to have a fighting chance to do better, I think many of > selfuncs.c > > currently private functions would have to be declared in some header > file, > > perhaps utils/selfuncs.h. But that then requires a cascade of other > > inclusions. Perhaps that is why it was not done. > > I'm just in the midst of refactoring that stuff, so if you have > suggestions, let's hear 'em. >
The goal would be that I can copy the entire definition of genericcostestimate into blcost.c, change the function's name, and get it to compile. I don't know the correct way accomplish that. Maybe utils/selfuncs.h can be expanded to work, or if there should be a new header file like "utils/index_am_cost.h" What I've done for now is: #include "../../src/backend/utils/adt/selfuncs.c" which I assume is not acceptable as a real solution. It's possible that a good cost model for bloom is so far outside > genericcostestimate's ideas that trying to use it is not a good > idea anyway. > I think that might be the case. I don't know what the right answer would look like, but I think it will likely end up needing to access everything that genericcostestimate currently needs to access. Or if bloom doesn't, some other extension implementing an ACCESS METHOD will. Cheers, Jeff