Skip to content

Commit 0c413d3

Browse files
committed
Add extra rows to join table in QueryPlanTests.
At extremely low cardinalities, we may pick a non-unique index with more columns than a unique index with fewer columns. This behavior disappears at higher cardinalities, which is where we care more about the performance.
1 parent fc9dc40 commit 0c413d3

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

enginetest/queries/query_plans.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ where
326326
" │ │ └─ org1 (longtext)\n" +
327327
" │ └─ TableAlias(dimension)\n" +
328328
" │ └─ IndexedTableAccess(asset)\n" +
329-
" │ ├─ index: [asset.orgId,asset.name,asset.val]\n" +
329+
" │ ├─ index: [asset.orgId,asset.name,asset.assetId]\n" +
330330
" │ └─ columns: [orgid assetid name val]\n" +
331331
" └─ Filter\n" +
332332
" ├─ AND\n" +
@@ -342,7 +342,7 @@ where
342342
" │ └─ org1 (longtext)\n" +
343343
" └─ TableAlias(style)\n" +
344344
" └─ IndexedTableAccess(asset)\n" +
345-
" ├─ index: [asset.orgId,asset.name,asset.val]\n" +
345+
" ├─ index: [asset.orgId,asset.name,asset.assetId]\n" +
346346
" └─ columns: [orgid assetid name val]\n" +
347347
"",
348348
},

enginetest/scriptgen/setup/scripts/join

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ insert into asset values
1919
(3, 'org1', 'small', 'retries', 'curve'),
2020
(4, 'org1', 'medium', 'style', 'straight'),
2121
(5, 'org1', 'medium', 'color', 'green'),
22-
(6, 'org1', 'medium', 'dimension', 'narrow');
22+
(6, 'org1', 'medium', 'dimension', 'narrow'),
23+
(7, 'org1', 'medium', 'retries', 'straight'),
24+
(8, 'org1', 'large', 'style', 'bendy'),
25+
(9, 'org1', 'large', 'color', 'red'),
26+
(10, 'org1', 'large', 'dimension', 'round'),
27+
(11, 'org1', 'large', 'retries', 'bendy');
2328
----
2429

2530
exec

enginetest/scriptgen/setup/setup_data.sg.go

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)