See the following TODO:
|
// TODO(dan): This could be made tighter, just the rows needed for RETURNING |
|
// exprs. |
We currently fetch all columns when an INSERT, UPDATE, or DELETE statement contains a RETURNING <exprs> clause. This is an issue because it forces us to retreive unnecessary data and it can create exrta contention. We should determine which columns the RETURNING expression needs and only request those exact columns.
This should be solved in conjunction with #18168 for maximum benefit.
See the following TODO:
cockroach/pkg/sql/update.go
Lines 191 to 192 in b2bd8e8
We currently fetch all columns when an
INSERT,UPDATE, orDELETEstatement contains aRETURNING <exprs>clause. This is an issue because it forces us to retreive unnecessary data and it can create exrta contention. We should determine which columns theRETURNINGexpression needs and only request those exact columns.This should be solved in conjunction with #18168 for maximum benefit.