github.com/whtcorpsinc/milevadb-prod@v0.0.0-20211104133533-f57f4be3b597/soliton/ranger/testdata/ranger_suite_out.json (about)

     1  [
     2    {
     3      "Name": "TestCompIndexInExprCorrDefCaus",
     4      "Cases": [
     5        {
     6          "ALLEGROALLEGROSQL": "explain select t.e in (select count(*) from t s use index(idx), t t1 where s.b = 1 and s.c in (1, 2) and s.d = t.a and s.a = t1.a) from t",
     7          "Result": [
     8            "Projection_11 2.00 root  DeferredCauset#17",
     9            "└─Apply_13 2.00 root  CARTESIAN left outer semi join, other cond:eq(test.t.e, DeferredCauset#16)",
    10            "  ├─BlockReader_15(Build) 2.00 root  data:BlockFullScan_14",
    11            "  │ └─BlockFullScan_14 2.00 cop[einsteindb] causet:t keep order:false",
    12            "  └─StreamAgg_20(Probe) 1.00 root  funcs:count(1)->DeferredCauset#16",
    13            "    └─IndexMergeJoin_46 2.00 root  inner join, inner:BlockReader_41, outer key:test.t.a, inner key:test.t.a",
    14            "      ├─IndexReader_33(Build) 2.00 root  index:IndexRangeScan_32",
    15            "      │ └─IndexRangeScan_32 2.00 cop[einsteindb] causet:s, index:idx(b, c, d) range: decided by [eq(test.t.b, 1) in(test.t.c, 1, 2) eq(test.t.d, test.t.a)], keep order:false",
    16            "      └─BlockReader_41(Probe) 1.00 root  data:BlockRangeScan_40",
    17            "        └─BlockRangeScan_40 1.00 cop[einsteindb] causet:t1 range: decided by [test.t.a], keep order:true"
    18          ]
    19        },
    20        {
    21          "ALLEGROALLEGROSQL": "select t.e in (select count(*) from t s use index(idx), t t1 where s.b = 1 and s.c in (1, 2) and s.d = t.a and s.a = t1.a) from t",
    22          "Result": [
    23            "1",
    24            "1"
    25          ]
    26        }
    27      ]
    28    },
    29    {
    30      "Name": "TestIndexStringIsTrueRange",
    31      "Cases": [
    32        {
    33          "ALLEGROALLEGROSQL": "explain select * from t0 where c0",
    34          "Result": [
    35            "BlockReader_7 0.80 root  data:Selection_6",
    36            "└─Selection_6 0.80 cop[einsteindb]  test.t0.c0",
    37            "  └─BlockFullScan_5 1.00 cop[einsteindb] causet:t0 keep order:false"
    38          ]
    39        },
    40        {
    41          "ALLEGROALLEGROSQL": "explain select * from t0 where c0 and c0 > '123'",
    42          "Result": [
    43            "IndexReader_7 1.00 root  index:Selection_6",
    44            "└─Selection_6 1.00 cop[einsteindb]  test.t0.c0",
    45            "  └─IndexRangeScan_5 1.00 cop[einsteindb] causet:t0, index:i0(c0) range:(\"123\",+inf], keep order:false"
    46          ]
    47        },
    48        {
    49          "ALLEGROALLEGROSQL": "explain select * from t0 where c0 and c0 <> '123'",
    50          "Result": [
    51            "IndexReader_7 1.00 root  index:Selection_6",
    52            "└─Selection_6 1.00 cop[einsteindb]  test.t0.c0",
    53            "  └─IndexRangeScan_5 1.00 cop[einsteindb] causet:t0, index:i0(c0) range:[-inf,\"123\"), (\"123\",+inf], keep order:false"
    54          ]
    55        },
    56        {
    57          "ALLEGROALLEGROSQL": "explain select * from t0 where c0 is true",
    58          "Result": [
    59            "BlockReader_7 0.80 root  data:Selection_6",
    60            "└─Selection_6 0.80 cop[einsteindb]  istrue(cast(test.t0.c0))",
    61            "  └─BlockFullScan_5 1.00 cop[einsteindb] causet:t0 keep order:false"
    62          ]
    63        },
    64        {
    65          "ALLEGROALLEGROSQL": "explain select * from t0 where c0 is false",
    66          "Result": [
    67            "BlockReader_7 0.80 root  data:Selection_6",
    68            "└─Selection_6 0.80 cop[einsteindb]  isfalse(cast(test.t0.c0))",
    69            "  └─BlockFullScan_5 1.00 cop[einsteindb] causet:t0 keep order:false"
    70          ]
    71        },
    72        {
    73          "ALLEGROALLEGROSQL": "explain select * from t0 where c0 and c0 in ('123','456','789')",
    74          "Result": [
    75            "IndexReader_7 1.00 root  index:Selection_6",
    76            "└─Selection_6 1.00 cop[einsteindb]  test.t0.c0",
    77            "  └─IndexRangeScan_5 1.00 cop[einsteindb] causet:t0, index:i0(c0) range:[\"123\",\"123\"], [\"456\",\"456\"], [\"789\",\"789\"], keep order:false"
    78          ]
    79        },
    80        {
    81          "ALLEGROALLEGROSQL": "explain SELECT * FROM t0 WHERE ('a' != t0.c0) AND t0.c0;",
    82          "Result": [
    83            "IndexReader_7 1.00 root  index:Selection_6",
    84            "└─Selection_6 1.00 cop[einsteindb]  test.t0.c0",
    85            "  └─IndexRangeScan_5 1.00 cop[einsteindb] causet:t0, index:i0(c0) range:[-inf,\"a\"), (\"a\",+inf], keep order:false"
    86          ]
    87        }
    88      ]
    89    },
    90    {
    91      "Name": "TestCompIndexDNFMatch",
    92      "Cases": [
    93        {
    94          "ALLEGROALLEGROSQL": "select * from t where a = 1 and b in (1, 2) and c > 1;",
    95          "Causet": [
    96            "IndexReader_6 0.67 root  index:IndexRangeScan_5",
    97            "└─IndexRangeScan_5 0.67 cop[einsteindb] causet:t, index:a(a, b, c) range:(1 1 1,1 1 +inf], (1 2 1,1 2 +inf], keep order:false, stats:pseudo"
    98          ],
    99          "Result": [
   100            "1 2 2"
   101          ]
   102        },
   103        {
   104          "ALLEGROALLEGROSQL": "select * from t where a = 1 and (b = 1 or b = 2) and c > 1;",
   105          "Causet": [
   106            "IndexReader_6 0.67 root  index:IndexRangeScan_5",
   107            "└─IndexRangeScan_5 0.67 cop[einsteindb] causet:t, index:a(a, b, c) range:(1 1 1,1 1 +inf], (1 2 1,1 2 +inf], keep order:false, stats:pseudo"
   108          ],
   109          "Result": [
   110            "1 2 2"
   111          ]
   112        },
   113        {
   114          "ALLEGROALLEGROSQL": "select * from t where a = 1 and (b = 1 or b in (2, 3)) and c > 1;",
   115          "Causet": [
   116            "IndexReader_6 1.00 root  index:IndexRangeScan_5",
   117            "└─IndexRangeScan_5 1.00 cop[einsteindb] causet:t, index:a(a, b, c) range:(1 1 1,1 1 +inf], (1 2 1,1 2 +inf], (1 3 1,1 3 +inf], keep order:false, stats:pseudo"
   118          ],
   119          "Result": [
   120            "1 2 2"
   121          ]
   122        },
   123        {
   124          "ALLEGROALLEGROSQL": "select * from t where a = 1 and (b = 1 or b = 2) and b = 3 and c > 1;",
   125          "Causet": [
   126            "BlockDual_5 0.00 root  rows:0"
   127          ],
   128          "Result": null
   129        },
   130        {
   131          "ALLEGROALLEGROSQL": "select * from t where a = 1 and (b is null or b = 2);",
   132          "Causet": [
   133            "IndexReader_6 0.20 root  index:IndexRangeScan_5",
   134            "└─IndexRangeScan_5 0.20 cop[einsteindb] causet:t, index:a(a, b, c) range:[1 NULL,1 NULL], [1 2,1 2], keep order:false, stats:pseudo"
   135          ],
   136          "Result": [
   137            "1 2 2"
   138          ]
   139        },
   140        {
   141          "ALLEGROALLEGROSQL": "select * from t where a = 1 and (b is null or b = 2) and c > 1;",
   142          "Causet": [
   143            "IndexReader_7 0.07 root  index:Selection_6",
   144            "└─Selection_6 0.07 cop[einsteindb]  gt(test.t.c, 1)",
   145            "  └─IndexRangeScan_5 0.20 cop[einsteindb] causet:t, index:a(a, b, c) range:[1 NULL,1 NULL], [1 2,1 2], keep order:false, stats:pseudo"
   146          ],
   147          "Result": [
   148            "1 2 2"
   149          ]
   150        },
   151        {
   152          "ALLEGROALLEGROSQL": "select * from t where a = 1 and b is null and c > 1;",
   153          "Causet": [
   154            "IndexReader_7 0.03 root  index:Selection_6",
   155            "└─Selection_6 0.03 cop[einsteindb]  gt(test.t.c, 1)",
   156            "  └─IndexRangeScan_5 0.10 cop[einsteindb] causet:t, index:a(a, b, c) range:[1 NULL,1 NULL], keep order:false, stats:pseudo"
   157          ],
   158          "Result": null
   159        },
   160        {
   161          "ALLEGROALLEGROSQL": "select * from t where a = 1 and b is null and b is null and c > 1;",
   162          "Causet": [
   163            "IndexReader_7 0.03 root  index:Selection_6",
   164            "└─Selection_6 0.03 cop[einsteindb]  gt(test.t.c, 1)",
   165            "  └─IndexRangeScan_5 0.10 cop[einsteindb] causet:t, index:a(a, b, c) range:[1 NULL,1 NULL], keep order:false, stats:pseudo"
   166          ],
   167          "Result": null
   168        },
   169        {
   170          "ALLEGROALLEGROSQL": "select * from t where a = 1 and b is null and b = 1 and c > 1;",
   171          "Causet": [
   172            "IndexReader_7 0.27 root  index:Selection_6",
   173            "└─Selection_6 0.27 cop[einsteindb]  isnull(test.t.b)",
   174            "  └─IndexRangeScan_5 0.33 cop[einsteindb] causet:t, index:a(a, b, c) range:(1 1 1,1 1 +inf], keep order:false, stats:pseudo"
   175          ],
   176          "Result": null
   177        }
   178      ]
   179    },
   180    {
   181      "Name": "TestCompIndexMultiDefCausDNF1",
   182      "Cases": [
   183        {
   184          "ALLEGROALLEGROSQL": "select * from t where (a,b) in ((1,1),(2,2)) and c = 3;",
   185          "Causet": [
   186            "Selection_6 1.00 root  eq(test.t.c, 3)",
   187            "└─Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b) keep order:false, desc:false"
   188          ],
   189          "Result": [
   190            "2 2 3"
   191          ]
   192        },
   193        {
   194          "ALLEGROALLEGROSQL": "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c = 3;",
   195          "Causet": [
   196            "Selection_6 1.00 root  eq(test.t.c, 3)",
   197            "└─Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b) keep order:false, desc:false"
   198          ],
   199          "Result": [
   200            "2 2 3"
   201          ]
   202        },
   203        {
   204          "ALLEGROALLEGROSQL": "select * from t use index(primary) where ((a = 1) or (a = 2 and b = 2)) and c = 3;",
   205          "Causet": [
   206            "BlockReader_7 0.75 root  data:Selection_6",
   207            "└─Selection_6 0.75 cop[einsteindb]  eq(test.t.c, 3), or(eq(test.t.a, 1), and(eq(test.t.a, 2), eq(test.t.b, 2)))",
   208            "  └─BlockRangeScan_5 2.00 cop[einsteindb] causet:t range:[1,1], [2,2], keep order:false"
   209          ],
   210          "Result": [
   211            "2 2 3"
   212          ]
   213        },
   214        {
   215          "ALLEGROALLEGROSQL": "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c = 3 and (a = 1 or a = 2);",
   216          "Causet": [
   217            "Selection_6 1.00 root  eq(test.t.c, 3), or(eq(test.t.a, 1), eq(test.t.a, 2))",
   218            "└─Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b) keep order:false, desc:false"
   219          ],
   220          "Result": [
   221            "2 2 3"
   222          ]
   223        },
   224        {
   225          "ALLEGROALLEGROSQL": "select * from t where (a,b) in ((1,1),(2,2)) and c > 2;",
   226          "Causet": [
   227            "Selection_6 1.00 root  gt(test.t.c, 2)",
   228            "└─Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b) keep order:false, desc:false"
   229          ],
   230          "Result": [
   231            "2 2 3"
   232          ]
   233        },
   234        {
   235          "ALLEGROALLEGROSQL": "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c > 2;",
   236          "Causet": [
   237            "Selection_6 1.00 root  gt(test.t.c, 2)",
   238            "└─Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b) keep order:false, desc:false"
   239          ],
   240          "Result": [
   241            "2 2 3"
   242          ]
   243        }
   244      ]
   245    },
   246    {
   247      "Name": "TestCompIndexMultiDefCausDNF2",
   248      "Cases": [
   249        {
   250          "ALLEGROALLEGROSQL": "select * from t where a = 1 and (b,c) in ((1,1),(2,3));",
   251          "Causet": [
   252            "Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b, c) keep order:false, desc:false"
   253          ],
   254          "Result": [
   255            "1 1 1"
   256          ]
   257        },
   258        {
   259          "ALLEGROALLEGROSQL": "select * from t where a = 1 and ((b = 1 and c = 1) or (b = 2 and c = 3));",
   260          "Causet": [
   261            "Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b, c) keep order:false, desc:false"
   262          ],
   263          "Result": [
   264            "1 1 1"
   265          ]
   266        },
   267        {
   268          "ALLEGROALLEGROSQL": "select * from t where a = 1 and ((b = 1) or (b = 2 and c = 3));",
   269          "Causet": [
   270            "BlockReader_6 2.00 root  data:BlockRangeScan_5",
   271            "└─BlockRangeScan_5 2.00 cop[einsteindb] causet:t range:[1 1,1 1], [1 2 3,1 2 3], keep order:false"
   272          ],
   273          "Result": [
   274            "1 1 1"
   275          ]
   276        },
   277        {
   278          "ALLEGROALLEGROSQL": "select * from t where (a,b) in ((1,1),(2,2)) and c = 3;",
   279          "Causet": [
   280            "Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b, c) keep order:false, desc:false"
   281          ],
   282          "Result": [
   283            "2 2 3"
   284          ]
   285        },
   286        {
   287          "ALLEGROALLEGROSQL": "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c = 3;",
   288          "Causet": [
   289            "Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b, c) keep order:false, desc:false"
   290          ],
   291          "Result": [
   292            "2 2 3"
   293          ]
   294        },
   295        {
   296          "ALLEGROALLEGROSQL": "select * from t use index(primary) where ((a = 1) or (a = 2 and b = 2)) and c = 3;",
   297          "Causet": [
   298            "BlockReader_7 0.75 root  data:Selection_6",
   299            "└─Selection_6 0.75 cop[einsteindb]  eq(test.t.c, 3), or(eq(test.t.a, 1), and(eq(test.t.a, 2), eq(test.t.b, 2)))",
   300            "  └─BlockRangeScan_5 2.00 cop[einsteindb] causet:t range:[1,1], [2,2], keep order:false"
   301          ],
   302          "Result": [
   303            "2 2 3"
   304          ]
   305        },
   306        {
   307          "ALLEGROALLEGROSQL": "select * from t where (a,b) in ((1,1),(2,2)) and c > 2 and (a,b,c) in ((1,1,1),(2,2,3));",
   308          "Causet": [
   309            "Selection_6 0.75 root  gt(test.t.c, 2), or(and(eq(test.t.a, 1), eq(test.t.b, 1)), and(eq(test.t.a, 2), eq(test.t.b, 2)))",
   310            "└─Batch_Point_Get_5 2.00 root causet:t, clustered index:PRIMARY(a, b, c) keep order:false, desc:false"
   311          ],
   312          "Result": [
   313            "2 2 3"
   314          ]
   315        },
   316        {
   317          "ALLEGROALLEGROSQL": "select * from t where (a,b) in ((1,1),(2,2)) and c > 2;",
   318          "Causet": [
   319            "BlockReader_6 1.00 root  data:BlockRangeScan_5",
   320            "└─BlockRangeScan_5 1.00 cop[einsteindb] causet:t range:(1 1 2,1 1 +inf], (2 2 2,2 2 +inf], keep order:false"
   321          ],
   322          "Result": [
   323            "2 2 3"
   324          ]
   325        },
   326        {
   327          "ALLEGROALLEGROSQL": "select * from t where ((a = 1 and b = 1) or (a = 2 and b = 2)) and c > 2;",
   328          "Causet": [
   329            "BlockReader_6 1.00 root  data:BlockRangeScan_5",
   330            "└─BlockRangeScan_5 1.00 cop[einsteindb] causet:t range:(1 1 2,1 1 +inf], (2 2 2,2 2 +inf], keep order:false"
   331          ],
   332          "Result": [
   333            "2 2 3"
   334          ]
   335        }
   336      ]
   337    }
   338  ]