Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize DAG request TypeTableScan executor. #188

Closed
birdstorm opened this issue Dec 29, 2017 · 1 comment
Closed

Optimize DAG request TypeTableScan executor. #188

birdstorm opened this issue Dec 29, 2017 · 1 comment

Comments

@birdstorm
Copy link
Contributor

Issue by Novemser
Wed Dec 13 02:52:14 2017
Originally opened as pingcap/tikv-client-lib-java#195


In some cases, TypeTableScan executor doesn't need to push down all the columns.

Like this, we only need to push down some of the columns for this request.

executors {
  tp: TypeTableScan
  tbl_scan {
    table_id: 363
    columns {
      column_id: 1
      tp: 3
      collation: 63
      columnLen: 11
      decimal: 0
      flag: 4227
      pk_handle: true
    }
    columns {
      column_id: 2
      tp: 15
      collation: 83
      columnLen: 45
      decimal: 0
      flag: 0
      pk_handle: false
    }
    columns {
      column_id: 3
      tp: 12
      collation: 63
      columnLen: 19
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 4
      tp: 252
      collation: 63
      columnLen: 65535
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 5
      tp: 254
      collation: 63
      columnLen: 2
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 6
      tp: 10
      collation: 63
      columnLen: 10
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 7
      tp: 7
      collation: 63
      columnLen: 19
      decimal: 0
      flag: 1153
      pk_handle: false
    }
    columns {
      column_id: 8
      tp: 13
      collation: 63
      columnLen: 4
      decimal: 0
      flag: 96
      pk_handle: false
    }
    columns {
      column_id: 9
      tp: 8
      collation: 63
      columnLen: 20
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 10
      tp: 246
      collation: 63
      columnLen: 11
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 11
      tp: 5
      collation: 63
      columnLen: 22
      decimal: -1
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 12
      tp: 4
      collation: 63
      columnLen: 12
      decimal: -1
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 13
      tp: 3
      collation: 63
      columnLen: 11
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 14
      tp: 9
      collation: 63
      columnLen: 9
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 15
      tp: 5
      collation: 63
      columnLen: 22
      decimal: -1
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 16
      tp: 2
      collation: 63
      columnLen: 6
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 17
      tp: 1
      collation: 63
      columnLen: 4
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 18
      tp: 254
      collation: 83
      columnLen: 10
      decimal: 0
      flag: 0
      pk_handle: false
    }
    columns {
      column_id: 19
      tp: 15
      collation: 83
      columnLen: 40
      decimal: 0
      flag: 0
      pk_handle: false
    }
    columns {
      column_id: 20
      tp: 251
      collation: 83
      columnLen: -1
      decimal: 0
      flag: 0
      pk_handle: false
    }
    columns {
      column_id: 21
      tp: 250
      collation: 83
      columnLen: 16777215
      decimal: 0
      flag: 0
      pk_handle: false
    }
    columns {
      column_id: 22
      tp: 252
      collation: 83
      columnLen: 65535
      decimal: 0
      flag: 0
      pk_handle: false
    }
    columns {
      column_id: 23
      tp: 249
      collation: 83
      columnLen: 255
      decimal: 0
      flag: 0
      pk_handle: false
    }
    columns {
      column_id: 24
      tp: 16
      collation: 63
      columnLen: 1
      decimal: 0
      flag: 32
      pk_handle: false
    }
    columns {
      column_id: 25
      tp: 11
      collation: 63
      columnLen: 10
      decimal: 0
      flag: 128
      pk_handle: false
    }
    columns {
      column_id: 26
      tp: 247
      collation: 83
      columnLen: -1
      decimal: 0
      flag: 0
      elems: "1"
      elems: "2"
      elems: "3"
      elems: "4"
      pk_handle: false
    }
    columns {
      column_id: 27
      tp: 248
      collation: 83
      columnLen: -1
      decimal: 0
      flag: 0
      elems: "a"
      elems: "b"
      elems: "c"
      elems: "d"
      pk_handle: false
    }
  }
}
executors {
  tp: TypeSelection
  selection {
    conditions {
      tp: ScalarFunc
      children {
        tp: ScalarFunc
        children {
          tp: ColumnRef
          val: "\200\000\000\000\000\000\000\005"
        }
        sig: TimeIsNull
        field_type {
          tp: 2
        }
      }
      sig: UnaryNot
      field_type {
        tp: 2
      }
    }
  }
}
time_zone_offset: 0
flags: 0
output_offsets: 5
}
@Novemser
Copy link
Contributor

Fixed by #143 and pingcap/tikv-client-lib-java#203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants