Skip to content

Commit

Permalink
executor: make SLOW_QUERY support query slow log at any time (#14840)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycs520 authored Feb 20, 2020
1 parent b98c88c commit b06e3e8
Show file tree
Hide file tree
Showing 5 changed files with 488 additions and 84 deletions.
12 changes: 8 additions & 4 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1354,12 +1354,16 @@ func (b *executorBuilder) buildMemTable(v *plannercore.PhysicalMemTable) Executo
},
}
case strings.ToLower(infoschema.TableSlowQuery), strings.ToLower(infoschema.ClusterTableSlowLog):
retriever := &slowQueryRetriever{
table: v.Table,
outputCols: v.Columns,
}
if v.Extractor != nil {
retriever.extractor = v.Extractor.(*plannercore.SlowQueryExtractor)
}
return &MemTableReaderExec{
baseExecutor: newBaseExecutor(b.ctx, v.Schema(), v.ExplainID()),
retriever: &SlowQueryRetriever{
table: v.Table,
outputCols: v.Columns,
},
retriever: retriever,
}
}
}
Expand Down
Loading

0 comments on commit b06e3e8

Please sign in to comment.