[
  {
    "Name": "TestUniqCompEqualEst",
    "Cases": [
      [
        "Point_Get_5 1.00 root table:t, clustered index:PRIMARY(a, b) "
      ]
    ]
  },
  {
    "Name": "TestStatsVer2",
    "Cases": [
      [
        "test tint  a 0 1 1",
        "test tint  a 0 2 1",
        "test tint  b 0 1 1",
        "test tint  b 0 2 1",
        "test tint  c 0 1 1",
        "test tint  c 0 2 1",
        "test tint  singular 1 1 1",
        "test tint  singular 1 2 1",
        "test tint  multi 1 (1, 1) 1",
        "test tint  multi 1 (2, 2) 1",
        "test tdouble  a 0 1 1",
        "test tdouble  a 0 2 1",
        "test tdouble  b 0 1 1",
        "test tdouble  b 0 2 1",
        "test tdouble  c 0 1 1",
        "test tdouble  c 0 2 1",
        "test tdouble  singular 1 1 1",
        "test tdouble  singular 1 2 1",
        "test tdouble  multi 1 (1, 1) 1",
        "test tdouble  multi 1 (2, 2) 1",
        "test tdecimal  a 0 1.00000000000000000000 1",
        "test tdecimal  a 0 2.00000000000000000000 1",
        "test tdecimal  b 0 1.00000000000000000000 1",
        "test tdecimal  b 0 2.00000000000000000000 1",
        "test tdecimal  c 0 1.00000000000000000000 1",
        "test tdecimal  c 0 2.00000000000000000000 1",
        "test tdecimal  singular 1 1.00000000000000000000 1",
        "test tdecimal  singular 1 2.00000000000000000000 1",
        "test tdecimal  multi 1 (1.00000000000000000000, 1.00000000000000000000) 1",
        "test tdecimal  multi 1 (2.00000000000000000000, 2.00000000000000000000) 1",
        "test tstring  a 0 1 1",
        "test tstring  a 0 2 1",
        "test tstring  b 0 1 1",
        "test tstring  b 0 2 1",
        "test tstring  c 0 1 1",
        "test tstring  c 0 2 1",
        "test tstring  singular 1 1 1",
        "test tstring  singular 1 2 1",
        "test tstring  multi 1 (1, 1) 1",
        "test tstring  multi 1 (2, 2) 1",
        "test tdatetime  a 0 2001-01-01 00:00:00 1",
        "test tdatetime  a 0 2001-01-02 00:00:00 1",
        "test tdatetime  b 0 2001-01-01 00:00:00 1",
        "test tdatetime  b 0 2001-01-02 00:00:00 1",
        "test tdatetime  c 0 2001-01-01 00:00:00 1",
        "test tdatetime  c 0 2001-01-02 00:00:00 1",
        "test tdatetime  singular 1 2001-01-01 00:00:00 1",
        "test tdatetime  singular 1 2001-01-02 00:00:00 1",
        "test tdatetime  multi 1 (2001-01-01 00:00:00, 2001-01-01 00:00:00) 1",
        "test tdatetime  multi 1 (2001-01-02 00:00:00, 2001-01-02 00:00:00) 1",
        "test tprefix  a 0 111 1",
        "test tprefix  a 0 222 1",
        "test tprefix  b 0 111 1",
        "test tprefix  b 0 222 1",
        "test tprefix  prefixa 1 11 1",
        "test tprefix  prefixa 1 22 1",
        "test ct1  a 0 1 1",
        "test ct1  a 0 2 1",
        "test ct1  pk 0 1 1",
        "test ct1  pk 0 2 1",
        "test ct1  PRIMARY 1 1 1",
        "test ct1  PRIMARY 1 2 1",
        "test ct2  a 0 1 1",
        "test ct2  a 0 2 1",
        "test ct2  b 0 1 1",
        "test ct2  b 0 2 1",
        "test ct2  c 0 1 1",
        "test ct2  c 0 2 1",
        "test ct2  PRIMARY 1 (1, 1) 1",
        "test ct2  PRIMARY 1 (2, 2) 1"
      ],
      [
        "test tint  a 0 0 3 1 3 5 0",
        "test tint  a 0 1 6 1 6 8 0",
        "test tint  b 0 0 3 1 3 5 0",
        "test tint  b 0 1 6 1 6 8 0",
        "test tint  c 0 0 3 1 3 5 0",
        "test tint  c 0 1 6 1 6 8 0",
        "test tint  singular 1 0 3 1 3 5 0",
        "test tint  singular 1 1 6 1 6 8 0",
        "test tint  multi 1 0 3 1 (3, 3) (5, 5) 0",
        "test tint  multi 1 1 6 1 (6, 6) (8, 8) 0",
        "test tdouble  a 0 0 3 1 3 5 0",
        "test tdouble  a 0 1 6 1 6 8 0",
        "test tdouble  b 0 0 3 1 3 5 0",
        "test tdouble  b 0 1 6 1 6 8 0",
        "test tdouble  c 0 0 3 1 3 5 0",
        "test tdouble  c 0 1 6 1 6 8 0",
        "test tdouble  singular 1 0 3 1 3 5 0",
        "test tdouble  singular 1 1 6 1 6 8 0",
        "test tdouble  multi 1 0 3 1 (3, 3) (5, 5) 0",
        "test tdouble  multi 1 1 6 1 (6, 6) (8, 8) 0",
        "test tdecimal  a 0 0 3 1 3.00000000000000000000 5.00000000000000000000 0",
        "test tdecimal  a 0 1 6 1 6.00000000000000000000 8.00000000000000000000 0",
        "test tdecimal  b 0 0 3 1 3.00000000000000000000 5.00000000000000000000 0",
        "test tdecimal  b 0 1 6 1 6.00000000000000000000 8.00000000000000000000 0",
        "test tdecimal  c 0 0 3 1 3.00000000000000000000 5.00000000000000000000 0",
        "test tdecimal  c 0 1 6 1 6.00000000000000000000 8.00000000000000000000 0",
        "test tdecimal  singular 1 0 3 1 3.00000000000000000000 5.00000000000000000000 0",
        "test tdecimal  singular 1 1 6 1 6.00000000000000000000 8.00000000000000000000 0",
        "test tdecimal  multi 1 0 3 1 (3.00000000000000000000, 3.00000000000000000000) (5.00000000000000000000, 5.00000000000000000000) 0",
        "test tdecimal  multi 1 1 6 1 (6.00000000000000000000, 6.00000000000000000000) (8.00000000000000000000, 8.00000000000000000000) 0",
        "test tstring  a 0 0 3 1 3 5 0",
        "test tstring  a 0 1 6 1 6 8 0",
        "test tstring  b 0 0 3 1 3 5 0",
        "test tstring  b 0 1 6 1 6 8 0",
        "test tstring  c 0 0 3 1 3 5 0",
        "test tstring  c 0 1 6 1 6 8 0",
        "test tstring  singular 1 0 3 1 3 5 0",
        "test tstring  singular 1 1 6 1 6 8 0",
        "test tstring  multi 1 0 3 1 (3, 3) (5, 5) 0",
        "test tstring  multi 1 1 6 1 (6, 6) (8, 8) 0",
        "test tdatetime  a 0 0 1 1 2001-01-03 00:00:00 2001-01-03 00:00:00 0",
        "test tdatetime  a 0 1 2 1 2001-01-04 00:00:00 2001-01-04 00:00:00 0",
        "test tdatetime  b 0 0 1 1 2001-01-03 00:00:00 2001-01-03 00:00:00 0",
        "test tdatetime  b 0 1 2 1 2001-01-04 00:00:00 2001-01-04 00:00:00 0",
        "test tdatetime  c 0 0 1 1 2001-01-03 00:00:00 2001-01-03 00:00:00 0",
        "test tdatetime  c 0 1 2 1 2001-01-04 00:00:00 2001-01-04 00:00:00 0",
        "test tdatetime  singular 1 0 1 1 2001-01-03 00:00:00 2001-01-03 00:00:00 0",
        "test tdatetime  singular 1 1 2 1 2001-01-04 00:00:00 2001-01-04 00:00:00 0",
        "test tdatetime  multi 1 0 1 1 (2001-01-03 00:00:00, 2001-01-03 00:00:00) (2001-01-03 00:00:00, 2001-01-03 00:00:00) 0",
        "test tdatetime  multi 1 1 2 1 (2001-01-04 00:00:00, 2001-01-04 00:00:00) (2001-01-04 00:00:00, 2001-01-04 00:00:00) 0",
        "test tprefix  a 0 0 2 1 333 444 0",
        "test tprefix  a 0 1 4 1 555 666 0",
        "test tprefix  b 0 0 2 1 333 444 0",
        "test tprefix  b 0 1 4 1 555 666 0",
        "test tprefix  prefixa 1 0 2 1 33 44 0",
        "test tprefix  prefixa 1 1 4 1 55 66 0",
        "test ct1  a 0 0 3 1 3 5 0",
        "test ct1  a 0 1 6 1 6 8 0",
        "test ct1  pk 0 0 3 1 3 5 0",
        "test ct1  pk 0 1 6 1 6 8 0",
        "test ct1  PRIMARY 1 0 3 1 3 5 0",
        "test ct1  PRIMARY 1 1 6 1 6 8 0",
        "test ct2  a 0 0 3 1 3 5 0",
        "test ct2  a 0 1 6 1 6 8 0",
        "test ct2  b 0 0 3 1 3 5 0",
        "test ct2  b 0 1 6 1 6 8 0",
        "test ct2  c 0 0 3 1 3 5 0",
        "test ct2  c 0 1 6 1 6 8 0",
        "test ct2  PRIMARY 1 0 3 1 (3, 3) (5, 5) 0",
        "test ct2  PRIMARY 1 1 6 1 (6, 6) (8, 8) 0"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.a, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.a, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.a, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.a, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.a, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.a, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.a, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.a, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.a, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.a, \"1\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.a, \"4\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.a, \"8\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.a, 2001-01-01 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.a, 2001-01-02 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.a, 2001-01-04 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tprefix.a, \"111\")",
        "  └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tprefix.a, \"444\")",
        "  └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tprefix.a, \"888\")",
        "  └─TableFullScan_5 6.00 cop[tikv] table:tprefix keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.b, 1), eq(test.tint.c, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.b, 4), eq(test.tint.c, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.b, 8), eq(test.tint.c, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.b, 1), eq(test.tdouble.c, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.b, 4), eq(test.tdouble.c, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.b, 8), eq(test.tdouble.c, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.b, 1), eq(test.tdecimal.c, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.b, 4), eq(test.tdecimal.c, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.b, 8), eq(test.tdecimal.c, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.b, \"1\"), eq(test.tstring.c, \"1\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.b, \"4\"), eq(test.tstring.c, \"4\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.b, \"8\"), eq(test.tstring.c, \"8\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.b, 2001-01-01 00:00:00.000000), eq(test.tdatetime.c, 2001-01-01 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.b, 2001-01-02 00:00:00.000000), eq(test.tdatetime.c, 2001-01-02 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.b, 2001-01-04 00:00:00.000000), eq(test.tdatetime.c, 2001-01-04 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.b, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.b, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tint.b, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tint keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.b, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.b, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdouble.b, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdouble keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.b, 1)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.b, 4)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdecimal.b, 8)",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tdecimal keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.b, \"1\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.b, \"4\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tstring.b, \"8\")",
        "  └─TableFullScan_5 8.00 cop[tikv] table:tstring keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.b, 2001-01-01 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.b, 2001-01-02 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.tdatetime.b, 2001-01-04 00:00:00.000000)",
        "  └─TableFullScan_5 4.00 cop[tikv] table:tdatetime keep order:false"
      ],
      [
        "TableReader_6 5.00 root  data:TableRangeScan_5",
        "└─TableRangeScan_5 5.00 cop[tikv] table:ct1 range:[\"1\",\"4\"], keep order:false"
      ],
      [
        "TableReader_6 3.75 root  data:TableRangeScan_5",
        "└─TableRangeScan_5 3.75 cop[tikv] table:ct1 range:[\"4\",\"6\"], keep order:false"
      ],
      [
        "TableReader_6 3.00 root  data:TableRangeScan_5",
        "└─TableRangeScan_5 3.00 cop[tikv] table:ct1 range:[\"6\",\"8\"], keep order:false"
      ],
      [
        "TableReader_6 1.00 root  data:TableRangeScan_5",
        "└─TableRangeScan_5 1.00 cop[tikv] table:ct2 range:[1 1,1 8], keep order:false"
      ],
      [
        "TableReader_6 1.00 root  data:TableRangeScan_5",
        "└─TableRangeScan_5 1.00 cop[tikv] table:ct2 range:[4 1,4 8], keep order:false"
      ],
      [
        "TableReader_6 1.00 root  data:TableRangeScan_5",
        "└─TableRangeScan_5 1.00 cop[tikv] table:ct2 range:[8 1,8 8], keep order:false"
      ]
    ]
  },
  {
    "Name": "TestTopNOutOfHist",
    "Cases": [
      [
        "test topn_before_hist  a 0 1 4",
        "test topn_before_hist  a 0 3 2",
        "test topn_before_hist  idx 1 1 4",
        "test topn_before_hist  idx 1 3 2",
        "test topn_after_hist  a 0 2 2",
        "test topn_after_hist  a 0 7 4",
        "test topn_after_hist  idx 1 2 2",
        "test topn_after_hist  idx 1 7 4",
        "test topn_before_hist_no_index  a 0 1 4",
        "test topn_before_hist_no_index  a 0 3 2",
        "test topn_after_hist_no_index  a 0 2 2",
        "test topn_after_hist_no_index  a 0 7 4"
      ],
      [
        "test topn_before_hist  a 0 0 2 1 4 5 0",
        "test topn_before_hist  a 0 1 3 1 6 6 0",
        "test topn_before_hist  idx 1 0 2 1 4 5 0",
        "test topn_before_hist  idx 1 1 3 1 6 6 0",
        "test topn_after_hist  a 0 0 2 1 3 4 0",
        "test topn_after_hist  a 0 1 3 1 5 5 0",
        "test topn_after_hist  idx 1 0 2 1 3 4 0",
        "test topn_after_hist  idx 1 1 3 1 5 5 0",
        "test topn_before_hist_no_index  a 0 0 2 1 4 5 0",
        "test topn_before_hist_no_index  a 0 1 3 1 6 6 0",
        "test topn_after_hist_no_index  a 0 0 2 1 3 4 0",
        "test topn_after_hist_no_index  a 0 1 3 1 5 5 0"
      ],
      [
        "IndexReader_6 4.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 4.00 cop[tikv] table:topn_before_hist, index:idx(a) range:[1,1], keep order:false"
      ],
      [
        "IndexReader_6 1.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 1.00 cop[tikv] table:topn_before_hist, index:idx(a) range:[2,2], keep order:false"
      ],
      [
        "IndexReader_6 4.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 4.00 cop[tikv] table:topn_after_hist, index:idx(a) range:[7,7], keep order:false"
      ],
      [
        "IndexReader_6 1.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 1.00 cop[tikv] table:topn_after_hist, index:idx(a) range:[6,6], keep order:false"
      ],
      [
        "TableReader_7 4.00 root  data:Selection_6",
        "└─Selection_6 4.00 cop[tikv]  eq(test.topn_after_hist_no_index.a, 7)",
        "  └─TableFullScan_5 9.00 cop[tikv] table:topn_after_hist_no_index keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.topn_after_hist_no_index.a, 6)",
        "  └─TableFullScan_5 9.00 cop[tikv] table:topn_after_hist_no_index keep order:false"
      ],
      [
        "TableReader_7 4.00 root  data:Selection_6",
        "└─Selection_6 4.00 cop[tikv]  eq(test.topn_before_hist_no_index.a, 1)",
        "  └─TableFullScan_5 9.00 cop[tikv] table:topn_before_hist_no_index keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  eq(test.topn_before_hist_no_index.a, 2)",
        "  └─TableFullScan_5 9.00 cop[tikv] table:topn_before_hist_no_index keep order:false"
      ]
    ]
  },
  {
    "Name": "TestColumnIndexNullEstimation",
    "Cases": [
      [
        "IndexReader_6 4.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 4.00 cop[tikv] table:t, index:idx_b(b) range:[NULL,NULL], keep order:false"
      ],
      [
        "IndexReader_6 1.00 root  index:IndexFullScan_5",
        "└─IndexFullScan_5 1.00 cop[tikv] table:t, index:idx_b(b) keep order:false"
      ],
      [
        "IndexReader_6 4.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 4.00 cop[tikv] table:t, index:idx_b(b) range:[NULL,NULL], (3,+inf], keep order:false"
      ],
      [
        "IndexReader_5 5.00 root  index:IndexFullScan_4",
        "└─IndexFullScan_4 5.00 cop[tikv] table:t, index:idx_b(b) keep order:false"
      ],
      [
        "IndexReader_6 1.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 1.00 cop[tikv] table:t, index:idx_b(b) range:[-inf,4), keep order:false"
      ],
      [
        "TableReader_7 1.00 root  data:Selection_6",
        "└─Selection_6 1.00 cop[tikv]  isnull(test.t.a)",
        "  └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
      ],
      [
        "TableReader_7 4.00 root  data:Selection_6",
        "└─Selection_6 4.00 cop[tikv]  not(isnull(test.t.a))",
        "  └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
      ],
      [
        "TableReader_7 2.00 root  data:Selection_6",
        "└─Selection_6 2.00 cop[tikv]  or(isnull(test.t.a), gt(test.t.a, 3))",
        "  └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
      ],
      [
        "TableReader_5 5.00 root  data:TableFullScan_4",
        "└─TableFullScan_4 5.00 cop[tikv] table:t keep order:false"
      ],
      [
        "TableReader_7 3.00 root  data:Selection_6",
        "└─Selection_6 3.00 cop[tikv]  lt(test.t.a, 4)",
        "  └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
      ]
    ]
  },
  {
    "Name": "TestDiscreteDistribution",
    "Cases": [
      [
        "IndexReader_6 0.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 0.00 cop[tikv] table:t, index:idx(a, b) range:[\"tw\" -inf,\"tw\" 0), keep order:false"
      ]
    ]
  },
  {
    "Name": "TestPrimaryKeySelectivity",
    "Cases": [
      [
        "TableReader_7 3333.33 root  data:Selection_6",
        "└─Selection_6 3333.33 cop[tikv]  gt(test.t.a, \"t\")",
        "  └─TableFullScan_5 10000.00 cop[tikv] table:t keep order:false, stats:pseudo"
      ],
      [
        "TableReader_6 3333.33 root  data:TableRangeScan_5",
        "└─TableRangeScan_5 3333.33 cop[tikv] table:t range:(1,+inf], keep order:false, stats:pseudo"
      ]
    ]
  },
  {
    "Name": "TestSelectCombinedLowBound",
    "Cases": [
      [
        "IndexReader_6 7.00 root  index:IndexRangeScan_5",
        "└─IndexRangeScan_5 7.00 cop[tikv] table:t, index:kid(kid, pid) range:[1,1], keep order:false"
      ]
    ]
  },
  {
    "Name": "TestCollationColumnEstimate",
    "Cases": [
      [
        "test t  a 0 \u0000A\u0000A\u0000A 2",
        "test t  a 0 \u0000B\u0000B\u0000B 2"
      ],
      [
        "TableReader_7 2.00 root  data:Selection_6",
        "└─Selection_6 2.00 cop[tikv]  eq(test.t.a, \"aÄa\")",
        "  └─TableFullScan_5 4.00 cop[tikv] table:t keep order:false"
      ],
      [
        "TableReader_7 2.00 root  data:Selection_6",
        "└─Selection_6 2.00 cop[tikv]  gt(test.t.a, \"aÄa\")",
        "  └─TableFullScan_5 4.00 cop[tikv] table:t keep order:false"
      ]
    ]
  },
  {
    "Name": "TestDNFCondSelectivity",
    "Cases": [
      {
        "SQL": "select * from t where b > 7 or c < 4",
        "Selectivity": 0.34375
      },
      {
        "SQL": "select * from t where d < 5 or b > 6",
        "Selectivity": 0.625
      },
      {
        "SQL": "select * from t where a > 8 or d < 4 or c > 7 or b < 5",
        "Selectivity": 0.82421875
      },
      {
        "SQL": "select * from t where a < 8 and (b > 10 or c < 3 or b > 4) and a > 2",
        "Selectivity": 0.3125
      }
    ]
  },
  {
    "Name": "TestSmallRangeEstimation",
    "Cases": [
      {
        "Start": 5,
        "End": 5,
        "Count": 3
      },
      {
        "Start": 5,
        "End": 6,
        "Count": 6
      },
      {
        "Start": 5,
        "End": 10,
        "Count": 18
      },
      {
        "Start": 5,
        "End": 15,
        "Count": 33
      },
      {
        "Start": 10,
        "End": 15,
        "Count": 18
      },
      {
        "Start": 5,
        "End": 25,
        "Count": 63
      },
      {
        "Start": 25,
        "End": 25,
        "Count": 3
      }
    ]
  },
  {
    "Name": "TestOutOfRangeEstimation",
    "Cases": [
      {
        "Start": 800,
        "End": 900,
        "Count": 752.004166655054
      },
      {
        "Start": 900,
        "End": 950,
        "Count": 247.04782734719248
      },
      {
        "Start": 950,
        "End": 1000,
        "Count": 226.14487557169574
      },
      {
        "Start": 1000,
        "End": 1050,
        "Count": 205.24192379619902
      },
      {
        "Start": 1050,
        "End": 1100,
        "Count": 184.33897202070227
      },
      {
        "Start": 1150,
        "End": 1200,
        "Count": 142.53306846970884
      },
      {
        "Start": 1200,
        "End": 1300,
        "Count": 214.85728161292752
      },
      {
        "Start": 1300,
        "End": 1400,
        "Count": 131.2454745109406
      },
      {
        "Start": 1400,
        "End": 1500,
        "Count": 47.650389770374105
      },
      {
        "Start": 1500,
        "End": 1600,
        "Count": 7.5
      },
      {
        "Start": 300,
        "End": 899,
        "Count": 4498.5
      },
      {
        "Start": 800,
        "End": 1000,
        "Count": 1201.196869573942
      },
      {
        "Start": 900,
        "End": 1500,
        "Count": 1502.495833344946
      },
      {
        "Start": 300,
        "End": 1500,
        "Count": 4500
      },
      {
        "Start": 200,
        "End": 300,
        "Count": 466.52882098990807
      },
      {
        "Start": 100,
        "End": 200,
        "Count": 382.91701388792114
      },
      {
        "Start": 200,
        "End": 400,
        "Count": 1211.5288209899081
      },
      {
        "Start": 200,
        "End": 1000,
        "Count": 4500
      },
      {
        "Start": 0,
        "End": 100,
        "Count": 299.3052067859343
      },
      {
        "Start": -100,
        "End": 100,
        "Count": 299.3052067859343
      },
      {
        "Start": -100,
        "End": 0,
        "Count": 7.5
      }
    ]
  },
  {
    "Name": "TestOutOfRangeEstimationAfterDelete",
    "Cases": [
      {
        "SQL": "explain format = 'brief' select * from t where a <= 300",
        "Result": [
          "TableReader 1003.33 root  data:Selection",
          "└─Selection 1003.33 cop[tikv]  le(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a < 300",
        "Result": [
          "TableReader 1000.00 root  data:Selection",
          "└─Selection 1000.00 cop[tikv]  lt(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a <= 500",
        "Result": [
          "TableReader 1670.00 root  data:Selection",
          "└─Selection 1670.00 cop[tikv]  le(test.t.a, 500)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a >= 300 and a <= 900",
        "Result": [
          "TableReader 2000.00 root  data:Selection",
          "└─Selection 2000.00 cop[tikv]  ge(test.t.a, 300), le(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a >= 900",
        "Result": [
          "TableReader 1000.00 root  data:Selection",
          "└─Selection 1000.00 cop[tikv]  ge(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 900",
        "Result": [
          "TableReader 1000.00 root  data:Selection",
          "└─Selection 1000.00 cop[tikv]  gt(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a >= 300",
        "Result": [
          "TableReader 2000.00 root  data:Selection",
          "└─Selection 2000.00 cop[tikv]  ge(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a <= 900",
        "Result": [
          "TableReader 2000.00 root  data:Selection",
          "└─Selection 2000.00 cop[tikv]  le(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 800 and a < 1000",
        "Result": [
          "TableReader 793.13 root  data:Selection",
          "└─Selection 793.13 cop[tikv]  gt(test.t.a, 800), lt(test.t.a, 1000)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 900 and a < 1000",
        "Result": [
          "TableReader 458.12 root  data:Selection",
          "└─Selection 458.12 cop[tikv]  gt(test.t.a, 900), lt(test.t.a, 1000)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 900 and a < 1100",
        "Result": [
          "TableReader 832.49 root  data:Selection",
          "└─Selection 832.49 cop[tikv]  gt(test.t.a, 900), lt(test.t.a, 1100)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 200 and a < 300",
        "Result": [
          "TableReader 458.12 root  data:Selection",
          "└─Selection 458.12 cop[tikv]  gt(test.t.a, 200), lt(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 100 and a < 300",
        "Result": [
          "TableReader 832.49 root  data:Selection",
          "└─Selection 832.49 cop[tikv]  gt(test.t.a, 100), lt(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      }
    ]
  },
  {
    "Name": "TestGlobalStatsOutOfRangeEstimationAfterDelete",
    "Cases": [
      {
        "SQL": "explain format = 'brief' select * from t where a <= 300",
        "Result": [
          "TableReader 1003.33 root partition:p0 data:Selection",
          "└─Selection 1003.33 cop[tikv]  le(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a < 300",
        "Result": [
          "TableReader 1000.00 root partition:p0 data:Selection",
          "└─Selection 1000.00 cop[tikv]  lt(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a <= 500",
        "Result": [
          "TableReader 1670.00 root partition:p0,p1 data:Selection",
          "└─Selection 1670.00 cop[tikv]  le(test.t.a, 500)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a >= 300 and a <= 900",
        "Result": [
          "TableReader 2000.00 root partition:p0,p1,p2,p3 data:Selection",
          "└─Selection 2000.00 cop[tikv]  ge(test.t.a, 300), le(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a >= 900",
        "Result": [
          "TableReader 1000.00 root partition:p3,p4 data:Selection",
          "└─Selection 1000.00 cop[tikv]  ge(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 900",
        "Result": [
          "TableReader 1000.00 root partition:p3,p4 data:Selection",
          "└─Selection 1000.00 cop[tikv]  gt(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a >= 300",
        "Result": [
          "TableReader 2000.00 root partition:all data:Selection",
          "└─Selection 2000.00 cop[tikv]  ge(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a <= 900",
        "Result": [
          "TableReader 2000.00 root partition:p0,p1,p2,p3 data:Selection",
          "└─Selection 2000.00 cop[tikv]  le(test.t.a, 900)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 800 and a < 1000",
        "Result": [
          "TableReader 793.20 root partition:p3 data:Selection",
          "└─Selection 793.20 cop[tikv]  gt(test.t.a, 800), lt(test.t.a, 1000)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 900 and a < 1000",
        "Result": [
          "TableReader 458.19 root partition:p3 data:Selection",
          "└─Selection 458.19 cop[tikv]  gt(test.t.a, 900), lt(test.t.a, 1000)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 900 and a < 1100",
        "Result": [
          "TableReader 832.77 root partition:p3,p4 data:Selection",
          "└─Selection 832.77 cop[tikv]  gt(test.t.a, 900), lt(test.t.a, 1100)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 200 and a < 300",
        "Result": [
          "TableReader 459.03 root partition:p0 data:Selection",
          "└─Selection 459.03 cop[tikv]  gt(test.t.a, 200), lt(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      },
      {
        "SQL": "explain format = 'brief' select * from t where a > 100 and a < 300",
        "Result": [
          "TableReader 834.45 root partition:p0 data:Selection",
          "└─Selection 834.45 cop[tikv]  gt(test.t.a, 100), lt(test.t.a, 300)",
          "  └─TableFullScan 2000.00 cop[tikv] table:t keep order:false"
        ]
      }
    ]
  }
]
