Open ozgune opened 8 years ago
Phase 1 for enabling triggers on distributed tables:
For reference tables, we will somehow need to distinguish between two types of triggers:
The two types are mutually exclusive and it's not clear which is preferable or how to let the user pick.
A common scenario for triggers it insert into an event log when the table is modified. In most case the even log will not be co-located with the source table. It will in many cases be bigger than the source table, so it should be distributed.
An option could be to introduce a specialized table type where inserts are always local. Alternatively, we should support nested transactions and ensure that subsequent commands do not read from the table or read only via the owner of the nested transaction.
We currently don't have native support built-in for distributed tables. Users who want to use triggers do so by manually creating them on a distributed table's shards on the worker nodes.
I'm opening this issue to track adding
CREATE TRIGGER
andDROP TRIGGER
support on distributed tables. I'm also listing a few use-cases that relate to trigger support below.CREATE TRIGGER
to all shards and shard placements: This could for example be useful in the context of full text search.CREATE TRIGGER
to all shards but only one of the shard placements: #228 and the mailing list update there talks about an example usage.CREATE TRIGGER
to pass along a notification: For example, an IoT database may need to alarm if the underlying sensor reports that the battery's charge rate < 5%.