Skip to content

Commit bfc4772

Browse files
committed
colbuilder: don't use direct scans when buffered writes are enabled
`txnWriteBuffer` currently doesn't support COL_BATCH_RESPONSE scan format, so if buffered writes are enabled, we won't use the direct scans. We could've relaxed this condition further to not use direct scans if at least some writes are actually buffered, but given this feature is in experimental state, we don't bother doing so for now. Release note: None
1 parent 5f91990 commit bfc4772

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/sql/colexec/colbuilder/execplan.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,17 @@ func NewColOperator(
842842
var resultTypes []*types.T
843843
if flowCtx.EvalCtx.SessionData().DirectColumnarScansEnabled {
844844
canUseDirectScan := func() bool {
845+
// txnWriteBuffer currently doesn't support
846+
// COL_BATCH_RESPONSE scan format, so if buffered writes are
847+
// enabled, we won't use the direct scans.
848+
//
849+
// We could've relaxed this condition further to not use
850+
// direct scans if at least some writes are actually
851+
// buffered, but given this feature is in experimental
852+
// state, we don't bother doing so for now.
853+
if flowCtx.Txn.BufferedWritesEnabled() {
854+
return false
855+
}
845856
// We currently don't use the direct scans if TraceKV is
846857
// enabled (due to not being able to tell the KV server
847858
// about it). One idea would be to include this boolean into

0 commit comments

Comments
 (0)