Repository navigation
[fix] don't use index if it has all PK columns - #22053
Conversation
|
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here. PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
to fix the bug that if user defines a secondary index on the primary key column, delete doesn't work Approved by: @ouyuanning
User description
What type of PR is this?
Which issue(s) this PR fixes:
issue https://github.com/matrixorigin/matrixflow/issues/6758
What this PR does / why we need it:
to fix the bug that if user defines a secondary index on the primary key column, delete doesn't work
PR Type
Bug fix
Description
Fix table existence inconsistency in DDL operations
Filter out indexes covering all primary key columns
Consolidate index validation logic across DML operations
Remove redundant index existence checks
Changes walkthrough 📝
bind_delete.go
Consolidate index validation in delete operationspkg/sql/plan/bind_delete.go
getValidIndexescall to filter valid indexesTableExistandIndexAlgochecksbind_insert.go
Add index filtering logic for insert operationspkg/sql/plan/bind_insert.go
getValidIndexesfunction to filter indexes covering all PK columnsTableExistandIndexAlgovalidation checksbind_replace.go
Consolidate index validation in replace operationspkg/sql/plan/bind_replace.go
getValidIndexescall for index validationTableExistchecks throughout replace logicbind_update.go
Consolidate index validation in update operationspkg/sql/plan/bind_update.go
getValidIndexescall to filter valid indexesvecAndTextIndexColstracking and related checksTableExistchecks