Add new list hideIndexes and develop new function by hypo_get_relation_info_hook.
User can hide or unhide existing index and hypothetical indexes.
When user set hide existing index and execute EXPLAIN, it will scan the same oid in hideIndexes and remove it to make query-plan can't use it.
Add regression tests for hiding existing indexes.
Update to version hypopg--1.4.0.
Provide simple examples of using the hide series functions in README.md.
Update doc about hypothetically hide existing indexes.
To avoid locking on pg_class (required to safely call GetNewOidWithIndex or
similar) and to be usable on a standby node, use the oids unused in the
FirstBootstrapObjectId / FirstNormalObjectId range rather than real oids. For
performance, always start with the biggest oid lesser than FirstNormalObjectId.
This way the loop to find an unused oid will only happens once a single backend
has created more than ~2.5k hypothetical indexes.
For people needing to have thousands of hypothetical indexes at the same time,
we also allow to use the initial implementation that relies on real oids, which
comes with all the limitations mentioned above, with the new
hypopg.use_real_oids GUC.