Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Signed-off-by: hallaroo <[email protected]>
  • Loading branch information
hallaroo committed Aug 20, 2021
1 parent 56a2288 commit 14fa1aa
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/local/vtexplain_atomicity_method1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -x
vtexplain -vschema-file vschema.json -schema-file schema.sql -shards 4 -sql 'INSERT /*vt+ MULTI_SHARD_AUTOCOMMIT=1 */ INTO t1 (c1) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);'
3 changes: 3 additions & 0 deletions examples/local/vtexplain_atomicity_method2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -x
vtexplain -vschema-file vschema.json -schema-file schema.sql -shards 4 -sql 'SET transaction_mode="single"; INSERT INTO t1 (c1) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);'
3 changes: 3 additions & 0 deletions examples/local/vtexplain_atomicity_method2_reads.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -x
vtexplain -vschema-file vschema.json -schema-file schema.sql -shards 4 -sql 'SET transaction_mode="single"; BEGIN; SELECT * from t1; COMMIT;'
3 changes: 3 additions & 0 deletions examples/local/vtexplain_atomicity_method2_working.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -x
vtexplain -vschema-file vschema.json -schema-file schema.sql -shards 4 -sql 'SET transaction_mode="single"; INSERT INTO t1 (c1) values (10),(14),(15),(16);'
4 changes: 4 additions & 0 deletions examples/local/vtexplain_atomicity_method3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -x
# SET transaction_mode="multi" is implied by default
vtexplain -vschema-file vschema.json -schema-file schema.sql -shards 4 -sql 'INSERT INTO t1 (c1) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);'
5 changes: 5 additions & 0 deletions examples/local/vtexplain_atomicity_schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE `t1` (
`c1` bigint unsigned NOT NULL,
PRIMARY KEY (`c1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

20 changes: 20 additions & 0 deletions examples/local/vtexplain_atomicity_vschema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"ks1": {
"sharded": true,
"vindexes": {
"xxhash": {
"type": "xxhash"
}
},
"tables": {
"t1": {
"columnVindexes": [
{
"column": "c1",
"name": "xxhash"
}
]
}
}
}
}

0 comments on commit 14fa1aa

Please sign in to comment.