Skip to content

Commit

Permalink
optimize offset operator in pipeline for tp query (#16706)
Browse files Browse the repository at this point in the history
optimize limit operator in pipeline for tp query, don't need mergeoffset

Approved by: @m-schen
  • Loading branch information
badboynt1 committed Jun 6, 2024
1 parent e1fd511 commit 9d9c849
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/sql/compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/offset"
"math"
"net"
"runtime"
Expand Down Expand Up @@ -2891,6 +2892,16 @@ func (c *Compile) compileFill(n *plan.Node, ss []*Scope) []*Scope {
}

func (c *Compile) compileOffset(n *plan.Node, ss []*Scope) []*Scope {
if c.execType == plan2.ExecTypeTP {
ss[0].appendInstruction(vm.Instruction{
Op: vm.Offset,
Idx: c.anal.curr,
IsFirst: c.anal.isFirst,
Arg: offset.NewArgument().WithOffset(n.Offset),
})
return ss
}

currentFirstFlag := c.anal.isFirst
for i := range ss {
if containBrokenNode(ss[i]) {
Expand Down

0 comments on commit 9d9c849

Please sign in to comment.