Skip to content

Conversation

@krleonid
Copy link
Owner

This PR eliminates the fallback path in PhysicalDelete that fetched columns by row ID when unique indexes exist but no RETURNING clause is present.

Changes:

  • Add BindDeleteIndexColumns helper to scan indexed columns at bind time
  • Add MERGE INTO overload that builds projection expressions
  • Extract common ConvertScanToProjectionMapping helper to reduce duplication
  • Remove fallback fetch-by-row-ID path in physical_delete.cpp
  • Add tests for DELETE and MERGE INTO DELETE with indexed tables

The optimization passes indexed columns through from the scan, avoiding the need to fetch them separately during DELETE execution.

This PR eliminates the fallback path in PhysicalDelete that fetched columns
by row ID when unique indexes exist but no RETURNING clause is present.

Changes:
- Add BindDeleteIndexColumns helper to scan indexed columns at bind time
- Add MERGE INTO overload that builds projection expressions
- Extract common ConvertScanToProjectionMapping helper to reduce duplication
- Remove fallback fetch-by-row-ID path in physical_delete.cpp
- Add tests for DELETE and MERGE INTO DELETE with indexed tables

The optimization passes indexed columns through from the scan, avoiding
the need to fetch them separately during DELETE execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants