citusdata / citusdata/citus

Some usages of TableReferenced might lead to false or unnecessary actions

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

Description

```c
UndistributeTable
src/backend/distributed/commands/create_distributed_table.c:
1614: if (TableReferenced(relationId))

ReplicateSingleShardTableToAllNodes
src/backend/distributed/utils/reference_table_utils.c:
411: if (foreignConstraintCommandList != NIL || TableReferenced(relationId))

ExecuteTruncateStmtSequentialIfNecessary
src/backend/distributed/commands/truncate.c:
323: TableReferenced(relationId))
```

First & second ones are to prevent undistributing a table or replicating a reference table when it's referenced. However, we could enable those two cases if the only referencing table is itself.

Third one is to switch to sequential execution when executing truncate. Again if the only referencing table is itself, we might not need to switch to sequential execution.

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.