vitess.io/vitess@v0.16.2/go/vt/vtgate/planbuilder/testdata/bypass_keyrange_cases.json (about) 1 [ 2 { 3 "comment": "select bypass", 4 "query": "select count(*), col from unsharded", 5 "plan": { 6 "QueryType": "SELECT", 7 "Original": "select count(*), col from unsharded", 8 "Instructions": { 9 "OperatorType": "Send", 10 "Keyspace": { 11 "Name": "main", 12 "Sharded": false 13 }, 14 "TargetDestination": "ExactKeyRange(-)", 15 "Query": "select count(*), col from unsharded" 16 } 17 } 18 }, 19 { 20 "comment": "update bypass", 21 "query": "update user set val = 1 where id = 18446744073709551616 and id = 1", 22 "plan": { 23 "QueryType": "UPDATE", 24 "Original": "update user set val = 1 where id = 18446744073709551616 and id = 1", 25 "Instructions": { 26 "OperatorType": "Send", 27 "Keyspace": { 28 "Name": "main", 29 "Sharded": false 30 }, 31 "TargetDestination": "ExactKeyRange(-)", 32 "IsDML": true, 33 "Query": "update `user` set val = 1 where id = 18446744073709551616 and id = 1" 34 } 35 } 36 }, 37 { 38 "comment": "update bypass autocommit", 39 "query": "update /*vt+ MULTI_SHARD_AUTOCOMMIT=1 */ user set val = 1 where id = 18446744073709551616 and id = 1", 40 "plan": { 41 "QueryType": "UPDATE", 42 "Original": "update /*vt+ MULTI_SHARD_AUTOCOMMIT=1 */ user set val = 1 where id = 18446744073709551616 and id = 1", 43 "Instructions": { 44 "OperatorType": "Send", 45 "Keyspace": { 46 "Name": "main", 47 "Sharded": false 48 }, 49 "TargetDestination": "ExactKeyRange(-)", 50 "IsDML": true, 51 "MultishardAutocommit": true, 52 "Query": "update /*vt+ MULTI_SHARD_AUTOCOMMIT=1 */ `user` set val = 1 where id = 18446744073709551616 and id = 1" 53 } 54 } 55 }, 56 { 57 "comment": "delete bypass", 58 "query": "DELETE FROM USER WHERE ID = 42", 59 "plan": { 60 "QueryType": "DELETE", 61 "Original": "DELETE FROM USER WHERE ID = 42", 62 "Instructions": { 63 "OperatorType": "Send", 64 "Keyspace": { 65 "Name": "main", 66 "Sharded": false 67 }, 68 "TargetDestination": "ExactKeyRange(-)", 69 "IsDML": true, 70 "Query": "delete from `USER` where ID = 42" 71 } 72 } 73 }, 74 { 75 "comment": "insert bypass: not supported", 76 "query": "INSERT INTO USER (ID, NAME) VALUES (42, 'ms X')", 77 "plan": "VT03023: INSERT not supported when targeting a key range: targetString" 78 }, 79 { 80 "comment": "bypass query for into outfile s3", 81 "query": "select count(*), col from unsharded into outfile S3 'x.txt'", 82 "plan": { 83 "QueryType": "SELECT", 84 "Original": "select count(*), col from unsharded into outfile S3 'x.txt'", 85 "Instructions": { 86 "OperatorType": "Send", 87 "Keyspace": { 88 "Name": "main", 89 "Sharded": false 90 }, 91 "TargetDestination": "ExactKeyRange(-)", 92 "Query": "select count(*), col from unsharded into outfile s3 'x.txt'" 93 } 94 } 95 }, 96 { 97 "comment": "Select outfile", 98 "query": "select * from user into outfile S3 'x.txt'", 99 "plan": { 100 "QueryType": "SELECT", 101 "Original": "select * from user into outfile S3 'x.txt'", 102 "Instructions": { 103 "OperatorType": "Send", 104 "Keyspace": { 105 "Name": "main", 106 "Sharded": false 107 }, 108 "TargetDestination": "ExactKeyRange(-)", 109 "Query": "select * from `user` into outfile s3 'x.txt'" 110 } 111 } 112 }, 113 { 114 "comment": "load data from s3 'x.txt' into table x", 115 "query": "load data from s3 'x.txt' into table x", 116 "plan": { 117 "QueryType": "OTHER", 118 "Original": "load data from s3 'x.txt' into table x", 119 "Instructions": { 120 "OperatorType": "Send", 121 "Keyspace": { 122 "Name": "main", 123 "Sharded": false 124 }, 125 "TargetDestination": "ExactKeyRange(-)", 126 "IsDML": true, 127 "Query": "load data from s3 'x.txt' into table x", 128 "SingleShardOnly": true 129 } 130 } 131 }, 132 { 133 "comment": "load data from s3 'x.txt'", 134 "query": "load data from s3 'x.txt'", 135 "plan": { 136 "QueryType": "OTHER", 137 "Original": "load data from s3 'x.txt'", 138 "Instructions": { 139 "OperatorType": "Send", 140 "Keyspace": { 141 "Name": "main", 142 "Sharded": false 143 }, 144 "TargetDestination": "ExactKeyRange(-)", 145 "IsDML": true, 146 "Query": "load data from s3 'x.txt'", 147 "SingleShardOnly": true 148 } 149 } 150 }, 151 { 152 "comment": "create table", 153 "query": "create /* test */ table t1(id bigint, primary key(id)) /* comments */", 154 "plan": { 155 "QueryType": "DDL", 156 "Original": "create /* test */ table t1(id bigint, primary key(id)) /* comments */", 157 "Instructions": { 158 "OperatorType": "Send", 159 "Keyspace": { 160 "Name": "main", 161 "Sharded": false 162 }, 163 "TargetDestination": "ExactKeyRange(-)", 164 "Query": "create /* test */ table t1(id bigint, primary key(id)) /* comments */" 165 } 166 } 167 } 168 ]