From 14fa1aada281ba8888187047d6d47d8c80434108 Mon Sep 17 00:00:00 2001 From: Marla Potterveld <5854253+hallaroo@users.noreply.github.com> Date: Fri, 20 Aug 2021 11:33:13 -0600 Subject: [PATCH] Add files via upload Signed-off-by: hallaroo --- examples/local/vtexplain_atomicity_method1.sh | 3 +++ examples/local/vtexplain_atomicity_method2.sh | 3 +++ .../vtexplain_atomicity_method2_reads.sh | 3 +++ .../vtexplain_atomicity_method2_working.sh | 3 +++ examples/local/vtexplain_atomicity_method3.sh | 4 ++++ examples/local/vtexplain_atomicity_schema.sql | 5 +++++ .../local/vtexplain_atomicity_vschema.json | 20 +++++++++++++++++++ 7 files changed, 41 insertions(+) create mode 100644 examples/local/vtexplain_atomicity_method1.sh create mode 100644 examples/local/vtexplain_atomicity_method2.sh create mode 100644 examples/local/vtexplain_atomicity_method2_reads.sh create mode 100644 examples/local/vtexplain_atomicity_method2_working.sh create mode 100644 examples/local/vtexplain_atomicity_method3.sh create mode 100644 examples/local/vtexplain_atomicity_schema.sql create mode 100644 examples/local/vtexplain_atomicity_vschema.json diff --git a/examples/local/vtexplain_atomicity_method1.sh b/examples/local/vtexplain_atomicity_method1.sh new file mode 100644 index 00000000000..b946ec7434f --- /dev/null +++ b/examples/local/vtexplain_atomicity_method1.sh @@ -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);' diff --git a/examples/local/vtexplain_atomicity_method2.sh b/examples/local/vtexplain_atomicity_method2.sh new file mode 100644 index 00000000000..33a09cbfbee --- /dev/null +++ b/examples/local/vtexplain_atomicity_method2.sh @@ -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);' diff --git a/examples/local/vtexplain_atomicity_method2_reads.sh b/examples/local/vtexplain_atomicity_method2_reads.sh new file mode 100644 index 00000000000..f32732ccfc5 --- /dev/null +++ b/examples/local/vtexplain_atomicity_method2_reads.sh @@ -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;' diff --git a/examples/local/vtexplain_atomicity_method2_working.sh b/examples/local/vtexplain_atomicity_method2_working.sh new file mode 100644 index 00000000000..f9c84e87a72 --- /dev/null +++ b/examples/local/vtexplain_atomicity_method2_working.sh @@ -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);' diff --git a/examples/local/vtexplain_atomicity_method3.sh b/examples/local/vtexplain_atomicity_method3.sh new file mode 100644 index 00000000000..772bae21460 --- /dev/null +++ b/examples/local/vtexplain_atomicity_method3.sh @@ -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);' diff --git a/examples/local/vtexplain_atomicity_schema.sql b/examples/local/vtexplain_atomicity_schema.sql new file mode 100644 index 00000000000..1bfc40eae4b --- /dev/null +++ b/examples/local/vtexplain_atomicity_schema.sql @@ -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; + diff --git a/examples/local/vtexplain_atomicity_vschema.json b/examples/local/vtexplain_atomicity_vschema.json new file mode 100644 index 00000000000..f6f869d758f --- /dev/null +++ b/examples/local/vtexplain_atomicity_vschema.json @@ -0,0 +1,20 @@ +{ + "ks1": { + "sharded": true, + "vindexes": { + "xxhash": { + "type": "xxhash" + } + }, + "tables": { + "t1": { + "columnVindexes": [ + { + "column": "c1", + "name": "xxhash" + } + ] + } + } + } +}