diff --git a/parser/ast/dml.go b/parser/ast/dml.go index 7bd1cacd4e3aa..93ee2c4632098 100644 --- a/parser/ast/dml.go +++ b/parser/ast/dml.go @@ -356,8 +356,8 @@ const ( HintUse IndexHintType = iota + 1 HintIgnore HintForce - HintKeepOrder - HintNoKeepOrder + HintOrderIndex + HintNoOrderIndex ) // IndexHintScope is the type for index hint for join, order by or group by. @@ -388,10 +388,10 @@ func (n *IndexHint) Restore(ctx *format.RestoreCtx) error { indexHintType = "IGNORE INDEX" case HintForce: indexHintType = "FORCE INDEX" - case HintKeepOrder: - indexHintType = "KEEP ORDER" - case HintNoKeepOrder: - indexHintType = "NO KEEP ORDER" + case HintOrderIndex: + indexHintType = "ORDER INDEX" + case HintNoOrderIndex: + indexHintType = "NO ORDER INDEX" default: // Prevent accidents return errors.New("IndexHintType has an error while matching") } diff --git a/parser/ast/misc.go b/parser/ast/misc.go index eac65d945bd96..32f8c7b27a7ed 100644 --- a/parser/ast/misc.go +++ b/parser/ast/misc.go @@ -3730,7 +3730,7 @@ func (n *TableOptimizerHint) Restore(ctx *format.RestoreCtx) error { } table.Restore(ctx) } - case "use_index", "ignore_index", "use_index_merge", "force_index", "keep_order", "no_keep_order": + case "use_index", "ignore_index", "use_index_merge", "force_index", "order_index", "no_order_index": n.Tables[0].Restore(ctx) ctx.WritePlain(" ") for i, index := range n.Indexes { diff --git a/parser/ast/misc_test.go b/parser/ast/misc_test.go index 36e8cb1ef002f..7379279d51567 100644 --- a/parser/ast/misc_test.go +++ b/parser/ast/misc_test.go @@ -228,18 +228,18 @@ func TestTableOptimizerHintRestore(t *testing.T) { {"IGNORE_INDEX(@sel_1 t1 c1)", "IGNORE_INDEX(@`sel_1` `t1` `c1`)"}, {"IGNORE_INDEX(t1@sel_1 c1)", "IGNORE_INDEX(`t1`@`sel_1` `c1`)"}, {"IGNORE_INDEX(t1@sel_1 partition(p0, p1) c1)", "IGNORE_INDEX(`t1`@`sel_1` PARTITION(`p0`, `p1`) `c1`)"}, - {"KEEP_ORDER(t1 c1)", "KEEP_ORDER(`t1` `c1`)"}, - {"KEEP_ORDER(test.t1 c1)", "KEEP_ORDER(`test`.`t1` `c1`)"}, - {"KEEP_ORDER(@sel_1 t1 c1)", "KEEP_ORDER(@`sel_1` `t1` `c1`)"}, - {"KEEP_ORDER(t1@sel_1 c1)", "KEEP_ORDER(`t1`@`sel_1` `c1`)"}, - {"KEEP_ORDER(test.t1@sel_1 c1)", "KEEP_ORDER(`test`.`t1`@`sel_1` `c1`)"}, - {"KEEP_ORDER(test.t1@sel_1 partition(p0) c1)", "KEEP_ORDER(`test`.`t1`@`sel_1` PARTITION(`p0`) `c1`)"}, - {"NO_KEEP_ORDER(t1 c1)", "NO_KEEP_ORDER(`t1` `c1`)"}, - {"NO_KEEP_ORDER(test.t1 c1)", "NO_KEEP_ORDER(`test`.`t1` `c1`)"}, - {"NO_KEEP_ORDER(@sel_1 t1 c1)", "NO_KEEP_ORDER(@`sel_1` `t1` `c1`)"}, - {"NO_KEEP_ORDER(t1@sel_1 c1)", "NO_KEEP_ORDER(`t1`@`sel_1` `c1`)"}, - {"NO_KEEP_ORDER(test.t1@sel_1 c1)", "NO_KEEP_ORDER(`test`.`t1`@`sel_1` `c1`)"}, - {"NO_KEEP_ORDER(test.t1@sel_1 partition(p0) c1)", "NO_KEEP_ORDER(`test`.`t1`@`sel_1` PARTITION(`p0`) `c1`)"}, + {"ORDER_INDEX(t1 c1)", "ORDER_INDEX(`t1` `c1`)"}, + {"ORDER_INDEX(test.t1 c1)", "ORDER_INDEX(`test`.`t1` `c1`)"}, + {"ORDER_INDEX(@sel_1 t1 c1)", "ORDER_INDEX(@`sel_1` `t1` `c1`)"}, + {"ORDER_INDEX(t1@sel_1 c1)", "ORDER_INDEX(`t1`@`sel_1` `c1`)"}, + {"ORDER_INDEX(test.t1@sel_1 c1)", "ORDER_INDEX(`test`.`t1`@`sel_1` `c1`)"}, + {"ORDER_INDEX(test.t1@sel_1 partition(p0) c1)", "ORDER_INDEX(`test`.`t1`@`sel_1` PARTITION(`p0`) `c1`)"}, + {"NO_ORDER_INDEX(t1 c1)", "NO_ORDER_INDEX(`t1` `c1`)"}, + {"NO_ORDER_INDEX(test.t1 c1)", "NO_ORDER_INDEX(`test`.`t1` `c1`)"}, + {"NO_ORDER_INDEX(@sel_1 t1 c1)", "NO_ORDER_INDEX(@`sel_1` `t1` `c1`)"}, + {"NO_ORDER_INDEX(t1@sel_1 c1)", "NO_ORDER_INDEX(`t1`@`sel_1` `c1`)"}, + {"NO_ORDER_INDEX(test.t1@sel_1 c1)", "NO_ORDER_INDEX(`test`.`t1`@`sel_1` `c1`)"}, + {"NO_ORDER_INDEX(test.t1@sel_1 partition(p0) c1)", "NO_ORDER_INDEX(`test`.`t1`@`sel_1` PARTITION(`p0`) `c1`)"}, {"TIDB_SMJ(`t1`)", "TIDB_SMJ(`t1`)"}, {"TIDB_SMJ(t1)", "TIDB_SMJ(`t1`)"}, {"TIDB_SMJ(t1,t2)", "TIDB_SMJ(`t1`, `t2`)"}, diff --git a/parser/hintparser.go b/parser/hintparser.go index a619d2a1c74f2..998d9b3823d08 100644 --- a/parser/hintparser.go +++ b/parser/hintparser.go @@ -70,7 +70,6 @@ const ( hintJoinOrder = 57352 hintJoinPrefix = 57353 hintJoinSuffix = 57354 - hintKeepOrder = 57400 hintLeading = 57410 hintLimitToCop = 57407 hintLooseScan = 57424 @@ -88,9 +87,9 @@ const ( hintNoHashJoin = 57362 hintNoICP = 57369 hintNoIndexMerge = 57366 - hintNoKeepOrder = 57401 hintNoMRR = 57368 hintNoMerge = 57364 + hintNoOrderIndex = 57401 hintNoRangeOptimization = 57370 hintNoSemijoin = 57374 hintNoSkipScan = 57372 @@ -98,6 +97,7 @@ const ( hintNthPlan = 57406 hintOLAP = 57413 hintOLTP = 57414 + hintOrderIndex = 57400 hintPartition = 57415 hintQBName = 57378 hintQueryType = 57390 @@ -151,29 +151,29 @@ var ( 57352: 17, // hintJoinOrder (135x) 57353: 18, // hintJoinPrefix (135x) 57354: 19, // hintJoinSuffix (135x) - 57400: 20, // hintKeepOrder (135x) - 57410: 21, // hintLeading (135x) - 57407: 22, // hintLimitToCop (135x) - 57375: 23, // hintMaxExecutionTime (135x) - 57388: 24, // hintMemoryQuota (135x) - 57363: 25, // hintMerge (135x) - 57382: 26, // hintMpp1PhaseAgg (135x) - 57383: 27, // hintMpp2PhaseAgg (135x) - 57367: 28, // hintMRR (135x) - 57356: 29, // hintNoBKA (135x) - 57358: 30, // hintNoBNL (135x) - 57412: 31, // hintNoDecorrelate (135x) - 57362: 32, // hintNoHashJoin (135x) - 57369: 33, // hintNoICP (135x) - 57366: 34, // hintNoIndexMerge (135x) - 57401: 35, // hintNoKeepOrder (135x) - 57364: 36, // hintNoMerge (135x) - 57368: 37, // hintNoMRR (135x) - 57370: 38, // hintNoRangeOptimization (135x) - 57374: 39, // hintNoSemijoin (135x) - 57372: 40, // hintNoSkipScan (135x) - 57389: 41, // hintNoSwapJoinInputs (135x) - 57406: 42, // hintNthPlan (135x) + 57410: 20, // hintLeading (135x) + 57407: 21, // hintLimitToCop (135x) + 57375: 22, // hintMaxExecutionTime (135x) + 57388: 23, // hintMemoryQuota (135x) + 57363: 24, // hintMerge (135x) + 57382: 25, // hintMpp1PhaseAgg (135x) + 57383: 26, // hintMpp2PhaseAgg (135x) + 57367: 27, // hintMRR (135x) + 57356: 28, // hintNoBKA (135x) + 57358: 29, // hintNoBNL (135x) + 57412: 30, // hintNoDecorrelate (135x) + 57362: 31, // hintNoHashJoin (135x) + 57369: 32, // hintNoICP (135x) + 57366: 33, // hintNoIndexMerge (135x) + 57364: 34, // hintNoMerge (135x) + 57368: 35, // hintNoMRR (135x) + 57401: 36, // hintNoOrderIndex (135x) + 57370: 37, // hintNoRangeOptimization (135x) + 57374: 38, // hintNoSemijoin (135x) + 57372: 39, // hintNoSkipScan (135x) + 57389: 40, // hintNoSwapJoinInputs (135x) + 57406: 41, // hintNthPlan (135x) + 57400: 42, // hintOrderIndex (135x) 57378: 43, // hintQBName (135x) 57390: 44, // hintQueryType (135x) 57391: 45, // hintReadConsistentReplica (135x) @@ -279,7 +279,6 @@ var ( "hintJoinOrder", "hintJoinPrefix", "hintJoinSuffix", - "hintKeepOrder", "hintLeading", "hintLimitToCop", "hintMaxExecutionTime", @@ -294,14 +293,15 @@ var ( "hintNoHashJoin", "hintNoICP", "hintNoIndexMerge", - "hintNoKeepOrder", "hintNoMerge", "hintNoMRR", + "hintNoOrderIndex", "hintNoRangeOptimization", "hintNoSemijoin", "hintNoSkipScan", "hintNoSwapJoinInputs", "hintNthPlan", + "hintOrderIndex", "hintQBName", "hintQueryType", "hintReadConsistentReplica", @@ -590,7 +590,7 @@ var ( yyhintParseTab = [284][]uint16{ // 0 - {1: 264, 230, 223, 225, 252, 260, 238, 239, 240, 250, 268, 242, 234, 232, 237, 202, 220, 221, 222, 253, 241, 265, 209, 214, 233, 261, 262, 243, 224, 226, 271, 227, 245, 266, 254, 228, 244, 246, 256, 248, 236, 210, 213, 218, 267, 219, 212, 255, 270, 211, 231, 247, 229, 269, 263, 235, 215, 258, 249, 251, 259, 257, 92: 216, 97: 203, 217, 100: 201, 208, 103: 207, 205, 200, 206, 204, 114: 199, 116: 198}, + {1: 264, 230, 223, 225, 252, 260, 238, 239, 240, 250, 268, 242, 234, 232, 237, 202, 220, 221, 222, 241, 265, 209, 214, 233, 261, 262, 243, 224, 226, 271, 227, 245, 266, 228, 244, 254, 246, 256, 248, 236, 210, 253, 213, 218, 267, 219, 212, 255, 270, 211, 231, 247, 229, 269, 263, 235, 215, 258, 249, 251, 259, 257, 92: 216, 97: 203, 217, 100: 201, 208, 103: 207, 205, 200, 206, 204, 114: 199, 116: 198}, {83: 197}, {1: 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 369, 83: 196, 88: 478}, {1: 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 83: 195}, @@ -692,7 +692,7 @@ var ( {1: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 64: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 274, 84: 282, 90: 281}, {63: 375, 78: 374}, // 85 - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 283}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 283}, {159, 63: 159, 78: 159}, {169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 274, 169, 361, 169, 84: 360}, {75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, 75}, @@ -786,24 +786,24 @@ var ( {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 78: 165, 80: 364, 99: 373}, - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 362}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 362}, // 165 {169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 274, 169, 80: 169, 84: 363}, {165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 78: 165, 80: 364, 99: 365}, {82: 366}, {156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 78: 156}, - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 368, 115: 367}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 368, 115: 367}, // 170 {370, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 369, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 88: 371}, {163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163}, {166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 64: 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 87: 166}, {164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 78: 164}, - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 372}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 372}, // 175 {162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162}, {157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 78: 157}, {170, 63: 170}, - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 376}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 376}, {158, 63: 158, 78: 158}, // 180 {1: 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 83: 173}, @@ -842,10 +842,10 @@ var ( {138}, {1: 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 83: 178}, // 210 - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 408}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 408}, {409, 63: 410}, {1: 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 83: 180}, - {169, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 274, 79: 169, 84: 414, 413, 108: 412, 121: 411}, + {169, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 274, 79: 169, 84: 414, 413, 108: 412, 121: 411}, {416, 79: 417}, // 215 {154, 79: 154}, @@ -854,15 +854,15 @@ var ( {153, 79: 153}, {1: 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 83: 179}, // 220 - {169, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 274, 79: 169, 84: 414, 413, 108: 418}, + {169, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 274, 79: 169, 84: 414, 413, 108: 418}, {155, 79: 155}, - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 420}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 420}, {421}, {1: 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 83: 181}, // 225 - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 423}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 423}, {81: 424}, - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 427, 428, 426, 120: 425}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 427, 428, 426, 120: 425}, {429}, {142}, // 230 @@ -896,14 +896,14 @@ var ( {1: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 64: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 274, 84: 452, 93: 451}, {460}, // 255 - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 453}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 453}, {167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 369, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 88: 454}, - {150, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 457, 112: 456, 455}, + {150, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 457, 112: 456, 455}, {151}, {149, 63: 458}, // 260 {148, 63: 148}, - {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 459}, + {1: 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 459}, {147, 63: 147}, {1: 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 83: 186}, {1: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 64: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 274, 84: 452, 93: 462}, @@ -914,7 +914,7 @@ var ( {468}, {161, 63: 375}, // 270 - {160, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 336, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 337, 299, 303, 305, 309, 307, 325, 342, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 283}, + {160, 314, 330, 290, 292, 343, 317, 294, 295, 296, 320, 316, 300, 321, 322, 323, 286, 287, 288, 289, 345, 315, 310, 324, 298, 318, 319, 302, 291, 293, 347, 297, 304, 301, 299, 303, 337, 305, 309, 307, 325, 342, 336, 313, 326, 327, 328, 312, 308, 346, 311, 331, 306, 329, 344, 332, 333, 340, 341, 335, 334, 338, 339, 64: 356, 357, 358, 359, 351, 350, 352, 348, 349, 353, 355, 354, 285, 85: 284, 89: 283}, {1: 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 83: 188}, {169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 64: 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 274, 84: 467, 90: 466, 96: 470}, {471}, @@ -927,7 +927,7 @@ var ( {477}, // 280 {1: 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 83: 191}, - {1: 264, 230, 223, 225, 252, 260, 238, 239, 240, 250, 268, 242, 234, 232, 237, 202, 220, 221, 222, 253, 241, 265, 209, 214, 233, 261, 262, 243, 224, 226, 271, 227, 245, 266, 254, 228, 244, 246, 256, 248, 236, 210, 213, 218, 267, 219, 212, 255, 270, 211, 231, 247, 229, 269, 263, 235, 215, 258, 249, 251, 259, 257, 92: 216, 97: 203, 217, 100: 480, 208, 103: 207, 205, 479, 206, 204}, + {1: 264, 230, 223, 225, 252, 260, 238, 239, 240, 250, 268, 242, 234, 232, 237, 202, 220, 221, 222, 241, 265, 209, 214, 233, 261, 262, 243, 224, 226, 271, 227, 245, 266, 228, 244, 254, 246, 256, 248, 236, 210, 253, 213, 218, 267, 219, 212, 255, 270, 211, 231, 247, 229, 269, 263, 235, 215, 258, 249, 251, 259, 257, 92: 216, 97: 203, 217, 100: 480, 208, 103: 207, 205, 479, 206, 204}, {1: 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 83: 194}, {1: 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 83: 192}, } diff --git a/parser/hintparser.y b/parser/hintparser.y index 0d92905bb86f3..0a29375be226d 100644 --- a/parser/hintparser.y +++ b/parser/hintparser.y @@ -103,8 +103,8 @@ import ( hintSwapJoinInputs "SWAP_JOIN_INPUTS" hintUseIndexMerge "USE_INDEX_MERGE" hintUseIndex "USE_INDEX" - hintKeepOrder "KEEP_ORDER" - hintNoKeepOrder "NO_KEEP_ORDER" + hintOrderIndex "ORDER_INDEX" + hintNoOrderIndex "NO_ORDER_INDEX" hintUsePlanCache "USE_PLAN_CACHE" hintUseToja "USE_TOJA" hintTimeRange "TIME_RANGE" @@ -609,8 +609,8 @@ SupportedIndexLevelOptimizerHintName: | "IGNORE_INDEX" | "USE_INDEX_MERGE" | "FORCE_INDEX" -| "KEEP_ORDER" -| "NO_KEEP_ORDER" +| "ORDER_INDEX" +| "NO_ORDER_INDEX" SubqueryOptimizerHintName: "SEMIJOIN" @@ -703,8 +703,8 @@ Identifier: | "SWAP_JOIN_INPUTS" | "USE_INDEX_MERGE" | "USE_INDEX" -| "KEEP_ORDER" -| "NO_KEEP_ORDER" +| "ORDER_INDEX" +| "NO_ORDER_INDEX" | "USE_PLAN_CACHE" | "USE_TOJA" | "TIME_RANGE" diff --git a/parser/misc.go b/parser/misc.go index 416412b531852..236b55f9b3c92 100644 --- a/parser/misc.go +++ b/parser/misc.go @@ -949,8 +949,8 @@ var hintTokenMap = map[string]int{ "SWAP_JOIN_INPUTS": hintSwapJoinInputs, "USE_INDEX_MERGE": hintUseIndexMerge, "USE_INDEX": hintUseIndex, - "KEEP_ORDER": hintKeepOrder, - "NO_KEEP_ORDER": hintNoKeepOrder, + "ORDER_INDEX": hintOrderIndex, + "NO_ORDER_INDEX": hintNoOrderIndex, "USE_PLAN_CACHE": hintUsePlanCache, "USE_TOJA": hintUseToja, "TIME_RANGE": hintTimeRange, diff --git a/parser/parser_test.go b/parser/parser_test.go index b85ae4b04fba1..bb4c14691c69f 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -3856,39 +3856,39 @@ func TestOptimizerHints(t *testing.T) { require.Len(t, hints[1].Indexes, 1) require.Equal(t, "t4", hints[1].Indexes[0].L) - // Test KEEP_ORDER - stmt, _, err = p.Parse("select /*+ KEEP_ORDER(T1,T2), keep_order(t3,t4) */ c1, c2 from t1, t2 where t1.c1 = t2.c1", "", "") + // Test ORDER_INDEX + stmt, _, err = p.Parse("select /*+ ORDER_INDEX(T1,T2), order_index(t3,t4) */ c1, c2 from t1, t2 where t1.c1 = t2.c1", "", "") require.NoError(t, err) selectStmt = stmt[0].(*ast.SelectStmt) hints = selectStmt.TableHints require.Len(t, hints, 2) - require.Equal(t, "keep_order", hints[0].HintName.L) + require.Equal(t, "order_index", hints[0].HintName.L) require.Len(t, hints[0].Tables, 1) require.Equal(t, "t1", hints[0].Tables[0].TableName.L) require.Len(t, hints[0].Indexes, 1) require.Equal(t, "t2", hints[0].Indexes[0].L) - require.Equal(t, "keep_order", hints[1].HintName.L) + require.Equal(t, "order_index", hints[1].HintName.L) require.Len(t, hints[1].Tables, 1) require.Equal(t, "t3", hints[1].Tables[0].TableName.L) require.Len(t, hints[1].Indexes, 1) require.Equal(t, "t4", hints[1].Indexes[0].L) - // Test NO_KEEP_ORDER - stmt, _, err = p.Parse("select /*+ NO_KEEP_ORDER(T1,T2), no_keep_order(t3,t4) */ c1, c2 from t1, t2 where t1.c1 = t2.c1", "", "") + // Test NO_ORDER_INDEX + stmt, _, err = p.Parse("select /*+ NO_ORDER_INDEX(T1,T2), no_order_index(t3,t4) */ c1, c2 from t1, t2 where t1.c1 = t2.c1", "", "") require.NoError(t, err) selectStmt = stmt[0].(*ast.SelectStmt) hints = selectStmt.TableHints require.Len(t, hints, 2) - require.Equal(t, "no_keep_order", hints[0].HintName.L) + require.Equal(t, "no_order_index", hints[0].HintName.L) require.Len(t, hints[0].Tables, 1) require.Equal(t, "t1", hints[0].Tables[0].TableName.L) require.Len(t, hints[0].Indexes, 1) require.Equal(t, "t2", hints[0].Indexes[0].L) - require.Equal(t, "no_keep_order", hints[1].HintName.L) + require.Equal(t, "no_order_index", hints[1].HintName.L) require.Len(t, hints[1].Tables, 1) require.Equal(t, "t3", hints[1].Tables[0].TableName.L) require.Len(t, hints[1].Indexes, 1) diff --git a/planner/core/integration_test.go b/planner/core/integration_test.go index b37c650ea853b..f8aa63eb3ccfb 100644 --- a/planner/core/integration_test.go +++ b/planner/core/integration_test.go @@ -1339,10 +1339,10 @@ func TestKeepOrderHint(t *testing.T) { tk.MustExec("create definer='root'@'localhost' view v1 as select * from t where a<10 order by a limit 1;") // If the optimizer can not generate the keep order plan, it will report error - err := tk.ExecToErr("explain select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 limit 1;") + err := tk.ExecToErr("explain select /*+ order_index(t1, idx_a) */ * from t1 where a<10 limit 1;") require.EqualError(t, err, "[planner:1815]Internal : Can't find a proper physical plan for this query") - err = tk.ExecToErr("explain select /*+ keep_order(t, primary) */ * from t where a<10 limit 1;") + err = tk.ExecToErr("explain select /*+ order_index(t, primary) */ * from t where a<10 limit 1;") require.EqualError(t, err, "[planner:1815]Internal : Can't find a proper physical plan for this query") // The partition table can not keep order @@ -1350,7 +1350,7 @@ func TestKeepOrderHint(t *testing.T) { err = tk.ExecToErr("select a from th where a<1 order by a limit 1;") require.NoError(t, err) - err = tk.ExecToErr("select /*+ keep_order(th, a) */ a from th where a<1 order by a limit 1;") + err = tk.ExecToErr("select /*+ order_index(th, a) */ a from th where a<1 order by a limit 1;") require.EqualError(t, err, "[planner:1815]Internal : Can't find a proper physical plan for this query") var input []string @@ -1382,15 +1382,15 @@ func TestKeepOrderHintWithBinding(t *testing.T) { tk.MustExec("drop table if exists t1") tk.MustExec("create table t1(a int, b int, index idx_a(a));") - // create binding for keep_order hint + // create binding for order_index hint tk.MustExec("select * from t1 where a<10 order by a limit 1;") tk.MustQuery("select @@last_plan_from_binding").Check(testkit.Rows("0")) - tk.MustExec("create global binding for select * from t1 where a<10 order by a limit 1 using select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1;") + tk.MustExec("create global binding for select * from t1 where a<10 order by a limit 1 using select /*+ order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;") tk.MustExec("select * from t1 where a<10 order by a limit 1;") tk.MustQuery("select @@last_plan_from_binding").Check(testkit.Rows("1")) res := tk.MustQuery("show global bindings").Rows() require.Equal(t, res[0][0], "select * from `test` . `t1` where `a` < ? order by `a` limit ?") - require.Equal(t, res[0][1], "SELECT /*+ keep_order(`t1` `idx_a`)*/ * FROM `test`.`t1` WHERE `a` < 10 ORDER BY `a` LIMIT 1") + require.Equal(t, res[0][1], "SELECT /*+ order_index(`t1` `idx_a`)*/ * FROM `test`.`t1` WHERE `a` < 10 ORDER BY `a` LIMIT 1") tk.MustExec("drop global binding for select * from t1 where a<10 order by a limit 1;") tk.MustExec("select * from t1 where a<10 order by a limit 1;") @@ -1398,13 +1398,13 @@ func TestKeepOrderHintWithBinding(t *testing.T) { res = tk.MustQuery("show global bindings").Rows() require.Equal(t, len(res), 0) - // create binding for no_keep_order hint - tk.MustExec("create global binding for select * from t1 where a<10 order by a limit 1 using select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1;") + // create binding for no_order_index hint + tk.MustExec("create global binding for select * from t1 where a<10 order by a limit 1 using select /*+ no_order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;") tk.MustExec("select * from t1 where a<10 order by a limit 1;") tk.MustQuery("select @@last_plan_from_binding").Check(testkit.Rows("1")) res = tk.MustQuery("show global bindings").Rows() require.Equal(t, res[0][0], "select * from `test` . `t1` where `a` < ? order by `a` limit ?") - require.Equal(t, res[0][1], "SELECT /*+ no_keep_order(`t1` `idx_a`)*/ * FROM `test`.`t1` WHERE `a` < 10 ORDER BY `a` LIMIT 1") + require.Equal(t, res[0][1], "SELECT /*+ no_order_index(`t1` `idx_a`)*/ * FROM `test`.`t1` WHERE `a` < 10 ORDER BY `a` LIMIT 1") tk.MustExec("drop global binding for select * from t1 where a<10 order by a limit 1;") tk.MustExec("select * from t1 where a<10 order by a limit 1;") diff --git a/planner/core/logical_plan_builder.go b/planner/core/logical_plan_builder.go index de0f40a1d7f03..49ddc1748dc0c 100644 --- a/planner/core/logical_plan_builder.go +++ b/planner/core/logical_plan_builder.go @@ -115,10 +115,10 @@ const ( HintIgnoreIndex = "ignore_index" // HintForceIndex make optimizer to use this index even if it thinks a table scan is more efficient. HintForceIndex = "force_index" - // HintKeepOrder is hint enforce using some indexes and keep the index's order. - HintKeepOrder = "keep_order" - // HintNoKeepOrder is hint enforce using some indexes and not keep the index's order. - HintNoKeepOrder = "no_keep_order" + // HintOrderIndex is hint enforce using some indexes and keep the index's order. + HintOrderIndex = "order_index" + // HintNoOrderIndex is hint enforce using some indexes and not keep the index's order. + HintNoOrderIndex = "no_order_index" // HintAggToCop is hint enforce pushing aggregation to coprocessor. HintAggToCop = "agg_to_cop" // HintReadFromStorage is hint enforce some tables read from specific type of storage. @@ -3593,7 +3593,7 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, currentLev // Set warning for the hint that requires the table name. switch hint.HintName.L { case TiDBMergeJoin, HintSMJ, TiDBIndexNestedLoopJoin, HintINLJ, HintINLHJ, HintINLMJ, - TiDBHashJoin, HintHJ, HintUseIndex, HintIgnoreIndex, HintForceIndex, HintKeepOrder, HintNoKeepOrder, HintIndexMerge, HintLeading: + TiDBHashJoin, HintHJ, HintUseIndex, HintIgnoreIndex, HintForceIndex, HintOrderIndex, HintNoOrderIndex, HintIndexMerge, HintLeading: if len(hint.Tables) == 0 { b.pushHintWithoutTableWarning(hint) continue @@ -3629,7 +3629,7 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, currentLev aggHints.preferAggType |= preferStreamAgg case HintAggToCop: aggHints.preferAggToCop = true - case HintUseIndex, HintIgnoreIndex, HintForceIndex, HintKeepOrder, HintNoKeepOrder: + case HintUseIndex, HintIgnoreIndex, HintForceIndex, HintOrderIndex, HintNoOrderIndex: dbName := hint.Tables[0].DBName if dbName.L == "" { dbName = model.NewCIStr(b.ctx.GetSessionVars().CurrentDB) @@ -3642,10 +3642,10 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, currentLev hintType = ast.HintIgnore case HintForceIndex: hintType = ast.HintForce - case HintKeepOrder: - hintType = ast.HintKeepOrder - case HintNoKeepOrder: - hintType = ast.HintNoKeepOrder + case HintOrderIndex: + hintType = ast.HintOrderIndex + case HintNoOrderIndex: + hintType = ast.HintNoOrderIndex } indexHintList = append(indexHintList, indexHintInfo{ dbName: dbName, diff --git a/planner/core/planbuilder.go b/planner/core/planbuilder.go index 56b75896f0568..8d780ab210066 100644 --- a/planner/core/planbuilder.go +++ b/planner/core/planbuilder.go @@ -1360,10 +1360,10 @@ func getPossibleAccessPaths(ctx sessionctx.Context, tableHints *tableHintInfo, i // our cost estimation is not reliable. hasUseOrForce = true path.Forced = true - if hint.HintType == ast.HintKeepOrder { + if hint.HintType == ast.HintOrderIndex { path.ForceKeepOrder = true } - if hint.HintType == ast.HintNoKeepOrder { + if hint.HintType == ast.HintNoOrderIndex { path.ForceNoKeepOrder = true } available = append(available, path) diff --git a/planner/core/testdata/integration_suite_in.json b/planner/core/testdata/integration_suite_in.json index e08a222ecbb04..a8c3d751691f8 100644 --- a/planner/core/testdata/integration_suite_in.json +++ b/planner/core/testdata/integration_suite_in.json @@ -656,55 +656,55 @@ { "name": "TestKeepOrderHint", "cases": [ - "explain select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - "explain select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 limit 1;", - "explain select /*+ no_keep_order(t, primary) */ * from t where a<10 limit 1;", + "explain select /*+ order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "explain select /*+ order_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t1, idx_a) */ * from t1 where a<10 limit 1;", + "explain select /*+ no_order_index(t, primary) */ * from t where a<10 limit 1;", // The index doesn't exist - "explain select /*+ keep_order(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", - "explain select /*+ keep_order(t, idx_b) */ * from t where b<10 order by b limit 1;", - "explain select /*+ no_keep_order(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", - "explain select /*+ no_keep_order(t, idx_b) */ * from t where b<10 order by b limit 1;", + "explain select /*+ order_index(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", + "explain select /*+ order_index(t, idx_b) */ * from t where b<10 order by b limit 1;", + "explain select /*+ no_order_index(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", + "explain select /*+ no_order_index(t, idx_b) */ * from t where b<10 order by b limit 1;", - // Use the keep_order/ no_keep_order with the use_index/ ignore_index/ force_index hint at the same time - "explain select /*+ keep_order(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - "explain select /*+ keep_order(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", - "explain select /*+ keep_order(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - "explain select /*+ keep_order(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", - "explain select /*+ keep_order(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + // Use the order_index/ no_order_index with the use_index/ ignore_index/ force_index hint at the same time + "explain select /*+ order_index(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "explain select /*+ order_index(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", + "explain select /*+ order_index(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "explain select /*+ order_index(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", + "explain select /*+ order_index(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - "explain select /*+ keep_order(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ keep_order(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", - "explain select /*+ keep_order(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ keep_order(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", - "explain select /*+ keep_order(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ order_index(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ order_index(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", + "explain select /*+ order_index(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ order_index(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", + "explain select /*+ order_index(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", - "explain select /*+ no_keep_order(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", + "explain select /*+ no_order_index(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", - // Use the keep_order/ no_keep_order with the use_view hint at the same time - "explain select /*+ qb_name(qb, v) keep_order(t1@qb, idx_a) */ * from v", - "explain select /*+ qb_name(qb, v1) keep_order(t@qb, primary) */ * from v1", - "explain select /*+ qb_name(qb, v) no_keep_order(t1@qb, idx_a) */ * from v", - "explain select /*+ qb_name(qb, v1) no_keep_order(t@qb, primary) */ * from v1", + // Use the order_index/ no_order_index with the use_view hint at the same time + "explain select /*+ qb_name(qb, v) order_index(t1@qb, idx_a) */ * from v", + "explain select /*+ qb_name(qb, v1) order_index(t@qb, primary) */ * from v1", + "explain select /*+ qb_name(qb, v) no_order_index(t1@qb, idx_a) */ * from v", + "explain select /*+ qb_name(qb, v1) no_order_index(t@qb, primary) */ * from v1", - // Use the keep_order/ no_keep_order with CTE at the same time - "explain WITH CTE AS (select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", - "explain WITH CTE AS (select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", - "explain WITH CTE AS (select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", - "explain WITH CTE AS (select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;" + // Use the order_index/ no_order_index with CTE at the same time + "explain WITH CTE AS (select /*+ order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", + "explain WITH CTE AS (select /*+ order_index(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", + "explain WITH CTE AS (select /*+ no_order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", + "explain WITH CTE AS (select /*+ no_order_index(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;" ] }, { diff --git a/planner/core/testdata/integration_suite_out.json b/planner/core/testdata/integration_suite_out.json index e8a111fc82a2e..0a899ab7e391c 100644 --- a/planner/core/testdata/integration_suite_out.json +++ b/planner/core/testdata/integration_suite_out.json @@ -4321,7 +4321,7 @@ "Name": "TestKeepOrderHint", "Cases": [ { - "SQL": "explain select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "Limit_12 1.00 root offset:0, count:1", "└─Projection_17 1.00 root test.t1.a, test.t1.b", @@ -4333,7 +4333,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "Limit_11 1.00 root offset:0, count:1", "└─TableReader_15 1.00 root data:Limit_14", @@ -4343,7 +4343,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "TopN_9 1.00 root test.t1.a, offset:0, count:1", "└─IndexLookUp_16 1.00 root ", @@ -4354,7 +4354,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t.a, offset:0, count:1", "└─TableReader_15 1.00 root data:TopN_14", @@ -4364,7 +4364,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_a) */ * from t1 where a<10 limit 1;", "Plan": [ "IndexLookUp_13 1.00 root limit embedded(offset:0, count:1)", "├─Limit_12(Build) 1.00 cop[tikv] offset:0, count:1", @@ -4374,7 +4374,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t, primary) */ * from t where a<10 limit 1;", + "SQL": "explain select /*+ no_order_index(t, primary) */ * from t where a<10 limit 1;", "Plan": [ "Limit_8 1.00 root offset:0, count:1", "└─TableReader_12 1.00 root data:Limit_11", @@ -4384,7 +4384,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", + "SQL": "explain select /*+ order_index(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", "Plan": [ "TopN_8 1.00 root test.t1.b, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4397,7 +4397,7 @@ ] }, { - "SQL": "explain select /*+ keep_order(t, idx_b) */ * from t where b<10 order by b limit 1;", + "SQL": "explain select /*+ order_index(t, idx_b) */ * from t where b<10 order by b limit 1;", "Plan": [ "TopN_8 1.00 root test.t.b, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4410,7 +4410,7 @@ ] }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_b) */ * from t1 where b<10 order by b limit 1;", "Plan": [ "TopN_8 1.00 root test.t1.b, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4423,7 +4423,7 @@ ] }, { - "SQL": "explain select /*+ no_keep_order(t, idx_b) */ * from t where b<10 order by b limit 1;", + "SQL": "explain select /*+ no_order_index(t, idx_b) */ * from t where b<10 order by b limit 1;", "Plan": [ "TopN_8 1.00 root test.t.b, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4436,7 +4436,7 @@ ] }, { - "SQL": "explain select /*+ keep_order(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "Limit_12 1.00 root offset:0, count:1", "└─Projection_19 1.00 root test.t1.a, test.t1.b", @@ -4448,7 +4448,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", "Plan": [ "Limit_12 1.00 root offset:0, count:1", "└─Projection_19 1.00 root test.t1.a, test.t1.b", @@ -4460,7 +4460,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "Limit_12 1.00 root offset:0, count:1", "└─Projection_19 1.00 root test.t1.a, test.t1.b", @@ -4472,7 +4472,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", "Plan": [ "Limit_12 1.00 root offset:0, count:1", "└─Projection_19 1.00 root test.t1.a, test.t1.b", @@ -4484,7 +4484,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t1.a, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4495,7 +4495,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "Limit_11 1.00 root offset:0, count:1", "└─TableReader_16 1.00 root data:Limit_15", @@ -4505,7 +4505,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", "Plan": [ "Limit_11 1.00 root offset:0, count:1", "└─TableReader_16 1.00 root data:Limit_15", @@ -4515,7 +4515,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "Limit_11 1.00 root offset:0, count:1", "└─TableReader_16 1.00 root data:Limit_15", @@ -4525,7 +4525,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", "Plan": [ "Limit_11 1.00 root offset:0, count:1", "└─TableReader_16 1.00 root data:Limit_15", @@ -4535,7 +4535,7 @@ "Warn": null }, { - "SQL": "explain select /*+ keep_order(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ order_index(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "Limit_11 1.00 root offset:0, count:1", "└─TableReader_15 1.00 root data:Limit_14", @@ -4545,7 +4545,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t, primary) use_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t.a, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4555,7 +4555,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t, primary) */ * from t use index(primary) where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t.a, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4565,7 +4565,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t, primary) force_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t.a, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4575,7 +4575,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t, primary) */ * from t force index(primary) where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t.a, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4585,7 +4585,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t, primary) ignore_index(t, primary) */ * from t where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t.a, offset:0, count:1", "└─TableReader_15 1.00 root data:TopN_14", @@ -4595,7 +4595,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_a) use_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "TopN_9 1.00 root test.t1.a, offset:0, count:1", "└─IndexLookUp_18 1.00 root ", @@ -4606,7 +4606,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_a) */ * from t1 use index(idx_a) where a<10 order by a limit 1;", "Plan": [ "TopN_9 1.00 root test.t1.a, offset:0, count:1", "└─IndexLookUp_18 1.00 root ", @@ -4617,7 +4617,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_a) force_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "TopN_9 1.00 root test.t1.a, offset:0, count:1", "└─IndexLookUp_18 1.00 root ", @@ -4628,7 +4628,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_a) */ * from t1 force index(idx_a) where a<10 order by a limit 1;", "Plan": [ "TopN_9 1.00 root test.t1.a, offset:0, count:1", "└─IndexLookUp_18 1.00 root ", @@ -4639,7 +4639,7 @@ "Warn": null }, { - "SQL": "explain select /*+ no_keep_order(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", + "SQL": "explain select /*+ no_order_index(t1, idx_a) ignore_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1;", "Plan": [ "TopN_8 1.00 root test.t1.a, offset:0, count:1", "└─TableReader_16 1.00 root data:TopN_15", @@ -4650,7 +4650,7 @@ "Warn": null }, { - "SQL": "explain select /*+ qb_name(qb, v) keep_order(t1@qb, idx_a) */ * from v", + "SQL": "explain select /*+ qb_name(qb, v) order_index(t1@qb, idx_a) */ * from v", "Plan": [ "Limit_14 1.00 root offset:0, count:1", "└─Projection_19 1.00 root test.t1.a, test.t1.b", @@ -4662,7 +4662,7 @@ "Warn": null }, { - "SQL": "explain select /*+ qb_name(qb, v1) keep_order(t@qb, primary) */ * from v1", + "SQL": "explain select /*+ qb_name(qb, v1) order_index(t@qb, primary) */ * from v1", "Plan": [ "Limit_13 1.00 root offset:0, count:1", "└─TableReader_17 1.00 root data:Limit_16", @@ -4672,7 +4672,7 @@ "Warn": null }, { - "SQL": "explain select /*+ qb_name(qb, v) no_keep_order(t1@qb, idx_a) */ * from v", + "SQL": "explain select /*+ qb_name(qb, v) no_order_index(t1@qb, idx_a) */ * from v", "Plan": [ "TopN_11 1.00 root test.t1.a, offset:0, count:1", "└─IndexLookUp_18 1.00 root ", @@ -4683,7 +4683,7 @@ "Warn": null }, { - "SQL": "explain select /*+ qb_name(qb, v1) no_keep_order(t@qb, primary) */ * from v1", + "SQL": "explain select /*+ qb_name(qb, v1) no_order_index(t@qb, primary) */ * from v1", "Plan": [ "TopN_10 1.00 root test.t.a, offset:0, count:1", "└─TableReader_17 1.00 root data:TopN_16", @@ -4693,7 +4693,7 @@ "Warn": null }, { - "SQL": "explain WITH CTE AS (select /*+ keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", + "SQL": "explain WITH CTE AS (select /*+ order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", "Plan": [ "HashAgg_30 2.00 root group by:Column#8, Column#9, funcs:firstrow(Column#8)->Column#8, funcs:firstrow(Column#9)->Column#9", "└─Union_31 1.28 root ", @@ -4713,7 +4713,7 @@ "Warn": null }, { - "SQL": "explain WITH CTE AS (select /*+ keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", + "SQL": "explain WITH CTE AS (select /*+ order_index(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", "Plan": [ "HashAgg_28 2.00 root group by:Column#7, Column#8, funcs:firstrow(Column#7)->Column#7, funcs:firstrow(Column#8)->Column#8", "└─Union_29 1.28 root ", @@ -4731,7 +4731,7 @@ "Warn": null }, { - "SQL": "explain WITH CTE AS (select /*+ no_keep_order(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", + "SQL": "explain WITH CTE AS (select /*+ no_order_index(t1, idx_a) */ * from t1 where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", "Plan": [ "HashAgg_29 2.00 root group by:Column#8, Column#9, funcs:firstrow(Column#8)->Column#8, funcs:firstrow(Column#9)->Column#9", "└─Union_30 1.28 root ", @@ -4750,7 +4750,7 @@ "Warn": null }, { - "SQL": "explain WITH CTE AS (select /*+ no_keep_order(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", + "SQL": "explain WITH CTE AS (select /*+ no_order_index(t, primary) */ * from t where a<10 order by a limit 1) SELECT * FROM CTE WHERE CTE.a <18 union select * from cte where cte.b > 1;", "Plan": [ "HashAgg_28 2.00 root group by:Column#7, Column#8, funcs:firstrow(Column#7)->Column#7, funcs:firstrow(Column#8)->Column#8", "└─Union_29 1.28 root ",