Remove the call to the Optimizer from several catalog instance initializations #1008
Description
We have many different global catalog singletons in our system, such as DatabaseCatalog
, ZoneMapCatalog
. (Ideally we want to combine those singletons together, but that's another longer discussion.)
We now have two ways to initialize a catalog instance:
https://github.com/cmu-db/peloton/blob/master/src/include/catalog/abstract_catalog.h#L48
https://github.com/cmu-db/peloton/blob/master/src/include/catalog/abstract_catalog.h#L53
The second way takes in a SQL DDL, and use the Optimizer
to generate the create plan and then initialize the catalog. This is problematic because the Optimizer
needs to use the information stored in the catalog to generate the plan (if implemented correctly...), but the catalogs are still under initialization here. And at the higher level, the Catalog
should not depend on the implementation of the Optimizer
just because this create plan generation here.
We should construct the plan/schema required by those catalog initializations by ourselves, and remove the Optimizer
dependency here. This includes these catalog objects:
ColumnStatsCatalog, DatabaseMetricsCatalog, IndexMetricCatalog, LanguageCatalog, ProcCatalog, QueryMetricsCatalog, SettingsCatalog, TriggerCatalog, and ZoneMapCatalog.
Other catalog objects are using the first way to initialize which is fine.