本文整理匯總了Golang中github.com/pingcap/tidb/optimizer/plan.TableScan類的典型用法代碼示例。如果您正苦於以下問題:Golang TableScan類的具體用法?Golang TableScan怎麽用?Golang TableScan使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了TableScan類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: buildTableScan
func (b *executorBuilder) buildTableScan(v *plan.TableScan) Executor {
table, _ := b.is.TableByID(v.Table.ID)
return &TableScanExec{
t: table,
fields: v.Fields(),
ctx: b.ctx,
ranges: v.Ranges,
seekHandle: math.MinInt64,
}
}
示例2: buildTableScan
func (b *executorBuilder) buildTableScan(v *plan.TableScan) Executor {
table, _ := b.is.TableByID(v.Table.ID)
e := &TableScanExec{
t: table,
fields: v.Fields(),
ctx: b.ctx,
ranges: v.Ranges,
seekHandle: math.MinInt64,
}
return b.buildFilter(e, v.FilterConditions)
}
示例3: buildTableScan
func (b *executorBuilder) buildTableScan(v *plan.TableScan) Executor {
txn, err := b.ctx.GetTxn(false)
if err != nil {
b.err = err
return nil
}
table, _ := b.is.TableByID(v.Table.ID)
client := txn.GetClient()
var memDB bool
switch v.Fields()[0].DBName.L {
case "information_schema", "performance_schema":
memDB = true
}
if !memDB && client.SupportRequestType(kv.ReqTypeSelect, 0) && txn.IsReadOnly() {
log.Debug("xapi select table")
e := &XSelectTableExec{
table: table,
ctx: b.ctx,
tablePlan: v,
}
where := conditionsToPBExpression(v.FilterConditions...)
if xapi.SupportExpression(client, where) {
e.where = where
return e
}
return b.buildFilter(e, v.FilterConditions)
}
e := &TableScanExec{
t: table,
fields: v.Fields(),
ctx: b.ctx,
ranges: v.Ranges,
seekHandle: math.MinInt64,
}
return b.buildFilter(e, v.FilterConditions)
}