> I understand that we need to hide guts of an implementation. But without > this the Index Advisor will have to emulate what LookupOpclassInfo() does > and that's a lot of code that I am afraid, if emulated by another function > in Index Advisor, is more prone to obsolecence than calling > IndexSupportInitialize().
The only reason you'd need that code is if you were trying to construct a fake Relation structure, which seems unnecessary and undesirable.
The planner requires IndexOptInfo, and for the planner to choose the hypothetical index we need to fill in the fwdsortop, revsortop, opfamily and opcintype, and this is the information that IndexAdvisor populates using IndexSupportInitialize() (at least until c0b5fac7 changed the function signature.
I am trying to populate an IndexOptInfo just like get_relation_info() does after the 'info = makeNode(IndexOptInfo);' line.
What would be the best way to build an IndexOptInfo for a plain BTREE index for different data types?