yugabyte / yugabyte/yugabyte-db

[YSQL] Use Index Only Scan in INSERT ... ON CONFLICT ... DO UPDATE

Open
#28,811 0 comments 0 reactions 1 assignee Claimed by @karthik-ramanathan-3006 View on GitHub
area/ysql kind/enhancement priority/medium
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.