1
votes

MonetDB documentation describes how to partition data, examples are show how to create a merge table and add tables into it. But what I can find is how to tell which tables are already added to a merge table. Where in the catalog I can find information which tables are added to a merge table?

https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/DataPartitioning

1

1 Answers

0
votes

either of these queries will get you the information from the sys tables (You may have to switch to the sys schema or add the "sys." prefix to the table names):

SELECT objects.name FROM objects WHERE objects.id = (SELECT id FROM tables WHERE tables.name = [your merge table's name]);

SELECT objects.name FROM objects LEFT JOIN tables ON objects.id=tables.id WHERE tables.name = [your merge table's name];

So the "objects" table has the info - and can be mapped to the "tables" table as suggested in the two queries above. There are another tables that you can possible join in and could add a layer of redundancy just in-case, as a verification that the mapping between the "tables" table and the "objects" table is correct; the "dependencies" table and the "dependency_types" table. "dependencies" appears to be a lookup table. Column "id" holds the table(table object) id. Column "depend_id" holds the table id (from the "tables table) of the merge table, and depend_type - when joined with the "dependency_types" table will show the that the tables that depend on the merge table are indeed dependent on a table and not some other object (dependency_type_id = 2 for a table I believe).