andygrove commented on code in PR #27999:
URL: https://github.com/apache/datafusion/pull/27999#discussion_r4789833644


##########
benchmarks/src/hj.rs:
##########
@@ -553,6 +553,97 @@ const HASH_QUERIES: &[HashJoinQuery] = &[
         probe_size: "100K_count",
         isolate_partitioned_join: true,
     },
+    // Q29: a fact table carrying four DECIMAL columns through a join to a 
small
+    // dimension, into an aggregation (a TPC-DS store_sales-to-dimension 
shape).
+    // Build Side: supplier (100K rows, CollectLeft) | Probe Side: lineitem 
(60M
+    // rows), each of which finds exactly one supplier, in order.
+    HashJoinQuery {
+        sql: r###"SELECT s.s_nationkey, sum(l.l_quantity), 
sum(l.l_extendedprice),
+          sum(l.l_discount), sum(l.l_tax)
+        FROM supplier s JOIN lineitem l ON s.s_suppkey = l.l_suppkey
+        GROUP BY s.s_nationkey"###,
+        density: 1.0,
+        prob_hit: 1.0,
+        build_size: "100K",
+        probe_size: "60M_4_decimal_payload",
+        isolate_partitioned_join: false,
+    },
+    // Q30: Q29 with one supplier in ten left out of the build side, so about 
90%
+    // of the probe rows find one.
+    HashJoinQuery {
+        sql: r###"SELECT s.s_nationkey, sum(l.l_quantity), 
sum(l.l_extendedprice),
+          sum(l.l_discount), sum(l.l_tax)
+        FROM (SELECT s_suppkey, s_nationkey FROM supplier WHERE s_suppkey % 10 
<> 0) s
+        JOIN lineitem l ON s.s_suppkey = l.l_suppkey
+        GROUP BY s.s_nationkey"###,
+        density: 0.9,
+        prob_hit: 0.9,
+        build_size: "90K",
+        probe_size: "60M_4_decimal_payload",
+        isolate_partitioned_join: false,
+    },
+    // Q31: Q29's payload through a Partitioned join to a large dimension.
+    // Build Side: orders (15M rows) | Probe Side: lineitem (60M rows), each of
+    // which finds exactly one order.
+    HashJoinQuery {
+        sql: r###"SELECT o.o_orderpriority, sum(l.l_quantity), 
sum(l.l_extendedprice),
+          sum(l.l_discount), sum(l.l_tax)
+        FROM orders o JOIN lineitem l ON o.o_orderkey = l.l_orderkey
+        GROUP BY o.o_orderpriority"###,
+        density: 1.0,

Review Comment:
   Small suggestion: TPC-H only populates 8 of every 32 order keys, so at SF10 
`o_orderkey` has 15M values spread over 1 to 60,000,000 (`SELECT 
min(o_orderkey), max(o_orderkey), count(DISTINCT o_orderkey) FROM orders` gives 
1, 60000000, 15000000). Since `density` ends up in the case name in the 
results, `0.25` would match the data here. The same goes for Q32's first join 
if it stays.
   
   ```suggestion
           density: 0.25,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to