-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
hash_sharded_index
74 lines (69 loc) · 2.4 KB
/
hash_sharded_index
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# LogicTest: local
statement ok
SET experimental_enable_hash_sharded_indexes = true;
statement ok
CREATE TABLE sharded_primary (a INT PRIMARY KEY USING HASH WITH BUCKET_COUNT=11)
query T
EXPLAIN (VERBOSE) INSERT INTO sharded_primary (a) VALUES (1), (2)
----
distribution: local
vectorized: true
·
• insert
│ columns: ()
│ estimated row count: 0 (missing stats)
│ into: sharded_primary(crdb_internal_a_shard_11, a)
│ auto commit
│
└── • render
│ columns: (crdb_internal_a_shard_11_comp, column1, check1)
│ estimated row count: 2
│ render check1: crdb_internal_a_shard_11_comp IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
│ render column1: column1
│ render crdb_internal_a_shard_11_comp: crdb_internal_a_shard_11_comp
│
└── • render
│ columns: (crdb_internal_a_shard_11_comp, column1)
│ estimated row count: 2
│ render crdb_internal_a_shard_11_comp: mod(fnv32(COALESCE(column1::STRING, '')), 11)::INT4
│ render column1: column1
│
└── • values
columns: (column1)
size: 1 column, 2 rows
row 0, expr 0: 1
row 1, expr 0: 2
statement ok
CREATE TABLE sharded_secondary (a INT8, INDEX (a) USING HASH WITH BUCKET_COUNT=12)
query T
EXPLAIN (VERBOSE) INSERT INTO sharded_secondary (a) VALUES (1), (2)
----
distribution: local
vectorized: true
·
• insert
│ columns: ()
│ estimated row count: 0 (missing stats)
│ into: sharded_secondary(a, crdb_internal_a_shard_12, rowid)
│ auto commit
│
└── • render
│ columns: (column1, crdb_internal_a_shard_12_comp, rowid_default, check1)
│ estimated row count: 2
│ render check1: crdb_internal_a_shard_12_comp IN (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
│ render column1: column1
│ render rowid_default: rowid_default
│ render crdb_internal_a_shard_12_comp: crdb_internal_a_shard_12_comp
│
└── • render
│ columns: (crdb_internal_a_shard_12_comp, rowid_default, column1)
│ estimated row count: 2
│ render crdb_internal_a_shard_12_comp: mod(fnv32(COALESCE(column1::STRING, '')), 12)::INT4
│ render rowid_default: unique_rowid()
│ render column1: column1
│
└── • values
columns: (column1)
size: 1 column, 2 rows
row 0, expr 0: 1
row 1, expr 0: 2