citusdata / citusdata/citus

Optimize noop upsert and other writes on reference tables

Open
#4,784 0 comments 0 reactions 0 assignees View on GitHub
performance
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

We currently always do a 2PC for INSERT INTO reference_table .. ON CONFLICT DO NOTHING, but we could check whether the local replica contains the value and if so avoid doing additional work.

A similar approach could work for UPDATE/DELETE, which may noop if no rows match the WHERE clause.

This would be particularly useful for workloads that try to normalize data on-the-fly by upserting e.g. a large text field into a reference table and storing an ID instead. If the same values recur frequently, the majority of transactions will be fast / single round trip.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.