Skip to content

Commit 340834d

Browse files
authored
feat: Add existence join to NestedLoopJoin benchmarks (#18005)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #16820 . ## Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> ## Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent 47fd638 commit 340834d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

benchmarks/src/nlj.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,45 @@ const NLJ_QUERIES: &[&str] = &[
146146
FULL JOIN range(30000) AS t2
147147
ON (t1.value > t2.value);
148148
"#,
149+
// Q13: LEFT SEMI 30K x 30K | HIGH 99.9%
150+
r#"
151+
SELECT t1.*
152+
FROM range(30000) AS t1
153+
LEFT SEMI JOIN range(30000) AS t2
154+
ON t1.value < t2.value;
155+
"#,
156+
// Q14: LEFT ANTI 30K x 30K | LOW 0.003%
157+
r#"
158+
SELECT t1.*
159+
FROM range(30000) AS t1
160+
LEFT ANTI JOIN range(30000) AS t2
161+
ON t1.value < t2.value;
162+
"#,
163+
// Q15: RIGHT SEMI 30K x 30K | HIGH 99.9%
164+
r#"
165+
SELECT t1.*
166+
FROM range(30000) AS t2
167+
RIGHT SEMI JOIN range(30000) AS t1
168+
ON t2.value < t1.value;
169+
"#,
170+
// Q16: RIGHT ANTI 30K x 30K | LOW 0.003%
171+
r#"
172+
SELECT t1.*
173+
FROM range(30000) AS t2
174+
RIGHT ANTI JOIN range(30000) AS t1
175+
ON t2.value < t1.value;
176+
"#,
177+
// Q17: LEFT MARK | HIGH 99.9%
178+
r#"
179+
SELECT *
180+
FROM range(30000) AS t2(k2)
181+
WHERE k2 > 0
182+
OR EXISTS (
183+
SELECT 1
184+
FROM range(30000) AS t1(k1)
185+
WHERE t2.k2 > t1.k1
186+
);
187+
"#,
149188
];
150189

151190
impl RunOpt {

0 commit comments

Comments
 (0)