Some usages of TableReferenced might lead to false or unnecessary actions
- 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
Assessment
This issue has not been assessed yet.