Hi, It looks to me as though any table AM that uses the relation forks supported by PostgreSQL in a more or less normal manner is likely to require an implementation of the relation_size callback that is identical to the one for heap, and an implementation of the estimate_rel_size method that is extremely similar to the one for heap. The latter is especially troubling as the amount of code duplication is non-trivial, and it's full of special hacks.
Here is a patch that tries to improve the situation. I don't know whether there is some better approach; this seemed like the obvious thing to do. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
0001-tableam-Provide-helper-functions-for-relation-sizing.patch
Description: Binary data