yugabyte / yugabyte/yugabyte-db
[YSQL] Use Index Only Scan in INSERT ... ON CONFLICT ... DO UPDATE
- Dominant language
- C
- Stars
- 10.5k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
Jira Link: [DB-18523](https://yugabyte.atlassian.net/browse/DB-18523)
### Description
#28324 introduced index-only scan support for the `DO NOTHING` clause of INSERT ... ON CONFLICT. This issue seeks to apply the same optimization for the `DO UPDATE` clause.
The optimization is applicable to `DO UPDATE` when:
- the old row is not referenced in the SET clause
- the columns being updated do not have secondary indexes on them (and thus do not require fetching the old row to perform the index update)
- there are no before-row-insert triggers on the table
### Issue Type
kind/enhancement
### Warning: Please confirm that this issue does not contain any sensitive information
- [x] I confirm this issue does not contain any sensitive information.
[DB-18523]: https://yugabyte.atlassian.net/browse/DB-18523?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.