3 ms·
Are the commands in the examples the actual SQL commands for sharding and is the default to have them in the public namespace? Ex: CREATE TABLE states (..
by koolba 10y ago
Are the commands in the examples the actual SQL commands for sharding and is the default to have them in the public namespace?
Ex:
CREATE TABLE states (...)
-- distribute it to all workers
SELECT create_reference_table('states');
SELECT isolate_tenant_to_new_shard('table_name', tenant_id);
While isolate_tenant_to_new_shard() doesn't seem like it'd clash with anything, create_reference_table() seems common enough to exist in someone's code. Why not have this in a citus schema by default?
> In Citus 6.1 Vacuum is now distributed and run in parallel automatically across your cluster.
Did VACUUM prior to 6.1 require one node in the cluster to issue locks on other nodes? If so what for? I'm not intimately familiar with how the nodes in the cluster communicate but would have figured each is acting as a standalone DB and coordinating common updates via 2PC (which means VACUUM was already distributed).
- ozgune 10y agoFair point on creating these functions in a Citus schema. The reason for this is mostly historical. We started with pg_catalog, haven't run into issues yet, and therefore didn't prioritize changing this [1]. On the VACUUM table side, when the user ran this command, we previously didn't propagate vacuum to the related shards. With this release, we run this command in parallel across worker nodes. (https://github.com/citusdata/citus/issues/719 https://github.com/citusdata/citus/issues/719) [1] Citus' user-defined functions aren't in the public, but rather in the pg_catalog schema. If the user defined their create_reference_table(), that definition would override the Citus definition. You'd then need to call the Citus function by fully qualifying its name or changing your search_path. As a footnote, if a user defines a create_reference_table() function, it would only override the Citus function if the two functions have the same signature: create_reference_table(table_name regclass). (edited)