should be it
This commit is contained in:
25
external/duckdb/benchmark/appian_benchmarks/appian.benchmark.in
vendored
Normal file
25
external/duckdb/benchmark/appian_benchmarks/appian.benchmark.in
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# name: ${FILE_PATH}
|
||||
# description: ${DESCRIPTION}
|
||||
# group: [clickbench]
|
||||
|
||||
name Q${QUERY_NUMBER_PADDED}
|
||||
group appian
|
||||
|
||||
require httpfs
|
||||
|
||||
cache ads.5M.duck
|
||||
|
||||
load
|
||||
LOAD httpfs;
|
||||
attach 'https://blobs.duckdb.org/data/appian_benchmark_data.duckdb' as appian_db (READ_ONLY);
|
||||
create table AddressView as select * from appian_db.AddressView;
|
||||
create table CustomerView as select * from appian_db.CustomerView;
|
||||
create table OrderView as select * from appian_db.OrderView;
|
||||
create table CategoryView as select * from appian_db.CategoryView;
|
||||
create table OrderItemNovelty_Update as select * from appian_db.OrderItemNovelty_Update;
|
||||
create table ProductView as select * from appian_db.ProductView;
|
||||
create table CreditCardView as select * from appian_db.CreditCardView;
|
||||
create table OrderItemView as select * from appian_db.OrderItemView;
|
||||
create table TaxRecordView as select * from appian_db.TaxRecordView;
|
||||
|
||||
run benchmark/appian_benchmarks/queries/q${QUERY_NUMBER_PADDED}.sql
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q01.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q01.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q01.benchmark
|
||||
# description: Run query 01 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=1
|
||||
QUERY_NUMBER_PADDED=01
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q02.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q02.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q02.benchmark
|
||||
# description: Run query 02 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=2
|
||||
QUERY_NUMBER_PADDED=02
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q03.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q03.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q03.benchmark
|
||||
# description: Run query 03 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=3
|
||||
QUERY_NUMBER_PADDED=03
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q04.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q04.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q04.benchmark
|
||||
# description: Run query 04 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=4
|
||||
QUERY_NUMBER_PADDED=04
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q05.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q05.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q05.benchmark
|
||||
# description: Run query 05 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=5
|
||||
QUERY_NUMBER_PADDED=05
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q06.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q06.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q06.benchmark
|
||||
# description: Run query 06 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=6
|
||||
QUERY_NUMBER_PADDED=06
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q07.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q07.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q07.benchmark
|
||||
# description: Run query 07 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=7
|
||||
QUERY_NUMBER_PADDED=07
|
||||
7
external/duckdb/benchmark/appian_benchmarks/q08.benchmark
vendored
Normal file
7
external/duckdb/benchmark/appian_benchmarks/q08.benchmark
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# name: benchmark/appian_benchmarks/q08.benchmark
|
||||
# description: Run query 08 from the appian benchmarks
|
||||
# group: [appian_benchmarks]
|
||||
|
||||
template benchmark/appian_benchmarks/appian.benchmark.in
|
||||
QUERY_NUMBER=8
|
||||
QUERY_NUMBER_PADDED=08
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q01.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q01.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select address_state as g0, sum(orderItem_quantity) as p0 from CustomerView c left outer join AddressView a on c.customer_id = a.address_customerId left outer join OrderView o on c.customer_id = o.order_customerId left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId group by address_state order by address_state limit 500;
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q02.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q02.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select a.address_state as g0, t1rp1 as g1, t2rp1 as g2, max(t5rp1) as p0, avg(t8rp1 * t8rp2) as p1, max(t6rp1) as p2, count(c.customer_priority) as p3, coalesce(avg(t7rp1), 0.0) as p4 from CustomerView c left outer join AddressView a on c.customer_id = a.address_customerId left outer join TaxRecordView t on a.address_id = t.taxRecord_addressId left outer join ( select sum(creditCard_cvv) as t1rp1, c.customer_id as t1pk from CustomerView c left outer join CreditCardView cc on c.customer_id = cc.creditCard_customerId group by c.customer_id ) t1 on c.customer_id = t1.t1pk left outer join ( select min(p.product_likes) as t2rp1, c.customer_id as t2pk from CustomerView c left outer join OrderView o on c.customer_id = o.order_customerId left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId left outer join ProductView p on oi.orderItem_productId = p.product_id left outer join CategoryView ca on p.product_categoryName = ca.category_name where ca.category_seasonal = true group by c.customer_id ) t2 on c.customer_id = t2.t2pk left outer join ( select max(o.order_subShipments) as t5rp1, c.customer_id as t5pk from CustomerView c left outer join OrderView o on c.customer_id = o.order_customerId group by c.customer_id ) t5 on c.customer_id = t5pk left outer join ( select max(coalesce(oi.orderItem_weight, 1)) as t6rp1, c.customer_id as t6pk from CustomerView c left outer join OrderView o on c.customer_id = o.order_customerId left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId where o.order_serverId in (1, 3, 5) group by c.customer_id ) t6 on c.customer_id = t6pk left outer join ( select count(ca.category_seasonal) as t7rp1, c.customer_id as t7pk from CustomerView c left outer join OrderView o on c.customer_id = o.order_customerId left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId left outer join ProductView p on oi.orderItem_productId = p.product_id left outer join CategoryView ca on p.product_categoryName = ca.category_name where ca.category_perishable = true group by c.customer_id ) t7 on c.customer_id = t7pk left outer join ( select sum(creditCard_zip) as t8rp1, sum(creditCard_lastChargeAmount) as t8rp2, c.customer_id as t8pk from CustomerView c left outer join OrderView o on c.customer_id = o.order_customerId left outer join CreditCardView cc on o.order_creditCardNumber = cc.creditCard_number group by c.customer_id ) t8 on c.customer_id = t8pk where t.taxRecord_value > 149670.0 group by a.address_state, t1rp1, t2rp1 order by g0, p0, p1 limit 500;
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q03.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q03.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select c.customer_priority as g0, t1rp1 as g1, t.taxRecord_bracket as g2, sum(oi.orderItem_weight) as p0, max(ca.category_demandScore) as p1, max(ca.category_auditDate) as p2, cast(avg(ca.category_valuation) as int) as p3, sum(t1rp2) as p4, sum( case when p.product_inventoryLastOrderedOn - ca.category_auditDate > 300 then 1 when p.product_inventoryLastOrderedOn - ca.category_auditDate > 150 then 10 when p.product_inventoryLastOrderedOn - ca.category_auditDate > 0 then 100 else 1000 end + (c.customer_priority * a.address_zone) ) as p5 from OrderItemView oi left outer join OrderView o on oi.orderItem_orderId = o.order_id left outer join ProductView p on oi.orderItem_productId = p.product_id left outer join CreditCardView cc on o.order_creditCardNumber = cc.creditCard_number left outer join CustomerView c on o.order_customerId = c.customer_id left outer join AddressView a on c.customer_id = a.address_customerId left outer join TaxRecordView t on a.address_id = t.taxRecord_addressId left outer join CategoryView ca on p.product_categoryName = ca.category_name left outer join ( select min(cc.creditCard_expirationDate) as t1rp1, sum(cc.creditCard_lastChargeAmount) as t1rp2, c.customer_id as t1pk from CustomerView c left outer join CreditCardView cc on c.customer_id = cc.creditCard_customerId group by c.customer_id ) t1 on c.customer_id = t1pk where cc.creditCard_lastChargeAmount > 90.0 and p.product_price > 34.0 group by c.customer_priority, t1rp1, t.taxRecord_bracket order by p1, p3, g2 limit 500;
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q04.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q04.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select t2rp1 as g0, t3rp1 as g1, t4rp1 as g2, cast(avg(cc.creditCard_lastChargeAmount) as int) as p0, min(cc.creditCard_lastChargeTimestamp) as p1, count(distinct(cc.creditCard_holder)) as p2 from CategoryView ca left outer join ProductView p on ca.category_name = p.product_categoryName left outer join OrderItemView oi on p.product_id = oi.orderItem_productId left outer join OrderView o on oi.orderItem_orderId = o.order_id left outer join CreditCardView cc on o.order_creditCardNumber = cc.creditCard_number left outer join ( select sum(taxRecord_bracket) as t1rp1, ca.category_name as t1pk from CategoryView ca left outer join ProductView p on ca.category_name = p.product_categoryName left outer join OrderItemView oi on p.product_id = oi.orderItem_productId left outer join OrderView o on oi.orderItem_orderId = o.order_id left outer join CustomerView c on o.order_customerId = c.customer_id left outer join AddressView a on c.customer_id = a.address_customerId left outer join TaxRecordView t on a.address_id = t.taxRecord_addressId group by ca.category_name ) t1 on ca.category_name = t1pk left outer join ( select max(p.product_likes) as t2rp1, ca.category_name as t2pk from CategoryView ca left outer join ProductView p on ca.category_name = p.product_categoryName group by ca.category_name ) t2 on ca.category_name = t2pk left outer join ( select sum(oi.orderItem_productGroup) as t3rp1, ca.category_name as t3pk from CategoryView ca left outer join ProductView p on ca.category_name = p.product_categoryName left outer join OrderItemView oi on p.product_id = oi.orderItem_productId where oi.orderItem_weight > 15.0 group by ca.category_name ) t3 on ca.category_name = t3pk left outer join ( select max(cc.creditCard_zip) as t4rp1, ca.category_name as t4pk from CategoryView ca left outer join ProductView p on ca.category_name = p.product_categoryName left outer join OrderItemView oi on p.product_id = oi.orderItem_productId left outer join OrderView o on oi.orderItem_orderId = o.order_id left outer join CreditCardView cc on o.order_creditCardNumber = cc.creditCard_number group by ca.category_name ) t4 on ca.category_name = t4pk where t1rp1 > 6 group by t2rp1, t3rp1, t4rp1 order by g1, p2 limit 500;
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q05.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q05.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select t.taxRecord_rate as g0, t2rp1 as g1, min(c.customer_balance) as p0 from TaxRecordView t left outer join AddressView a on t.taxRecord_addressId = a.address_id left outer join CustomerView c on a.address_customerId = c.customer_id left outer join ( select min(o.order_placedOn) as t1rp1, t.taxRecord_id as t1pk from TaxRecordView t left outer join AddressView a on t.taxRecord_addressId = a.address_id left outer join OrderView o on a.address_customerId = o.order_customerId group by t.taxRecord_id ) t1 on t.taxRecord_id = t1pk left outer join ( select sum(p.product_price * oi.orderItem_quantity) as t2rp1, t.taxRecord_id as t2pk from TaxRecordView t left outer join AddressView a on t.taxRecord_addressId = a.address_id left outer join OrderView o on a.address_customerId = o.order_customerId left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId left outer join ProductView p on oi.orderItem_productId = p.product_id group by t.taxRecord_id ) t2 on t.taxRecord_id = t2pk where t1rp1 > '2020-01-14 12:12:30.0' group by t.taxRecord_rate, t2rp1 order by p0 limit 500;
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q06.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q06.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select t1rp2 as g0, sum(t1rp3)/sum(t1rp4) as p0, sum( case when t1rp5 > 1 then 1 when t2rp1 > 20200 then 2 when t1rp6 > 15 then 3 when t3rp1 > 150 then 4 else 5 end ) as p1 from ProductView p left outer join ( select avg(a.address_valuation) as t1rp1, sum(a.address_zone) as t1rp2, sum(a.address_zone) as t1rp3, count(a.address_zone) as t1rp4, avg(o.order_serverId) as t1rp5, avg(c.customer_balance) as t1rp6, p.product_id as t1pk from ProductView p left outer join OrderItemView oi on p.product_id = oi.orderItem_productId left outer join OrderView o on oi.orderItem_orderId = o.order_id left outer join AddressView a on o.order_customerId = a.address_customerId left outer join CustomerView c on o.order_customerId = c.customer_id group by p.product_id ) t1 on p.product_id = t1pk left outer join ( select min(a.address_zip) as t2rp1, p.product_id as t2pk from ProductView p left outer join OrderItemView oi on p.product_id = oi.orderItem_productId left outer join OrderView o on oi.orderItem_orderId = o.order_id left outer join AddressView a on o.order_customerId = a.address_customerId where a.address_state in ('PA', 'CA', 'VA', 'MA', 'ME', 'MD', 'CO', 'MO') group by p.product_id ) t2 on p.product_id = t2pk left outer join ( select ca.category_warehouseSqft as t3rp1, p.product_id as t3pk from ProductView p left outer join CategoryView ca on p.product_categoryName = ca.category_name where ca.category_seasonal = true ) t3 on p.product_id = t3pk where t1rp1 > 10000.0 group by t1rp2 order by p0 limit 500;
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q07.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q07.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select t1rp1 as g0, t2rp1 as g1, c.customer_age as g2, c.customer_balance as g3, count(c.customer_name) as p0, sum(c.customer_age) as p1 from CustomerView c left outer join AddressView a on c.customer_id = a.address_customerId left outer join TaxRecordView t on a.address_id = t.taxRecord_addressId left outer join ( select avg(oi.orderItem_weight) as t1rp1, c.customer_id as t1pk from CustomerView c left outer join OrderView o on c.customer_id = o.order_customerId left outer join CreditCardView cc on o.order_creditCardNumber = cc.creditCard_number left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId where creditCard_cvv in (113, 115, 117, 119, 121) group by c.customer_id ) t1 on c.customer_id = t1pk left outer join ( select avg((oi.orderItem_quantity * p.product_price)/(oi.orderItem_weight + oi.orderItem_sku)) as t2rp1, c.customer_id as t2pk from CustomerView c left outer join OrderView o on c.customer_id = o.order_customerId left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId left outer join ProductView p on oi.orderItem_productId = p.product_id left outer join CategoryView ca on p.product_categoryName = ca.category_name where ca.category_name in ('Pet', 'Food', 'Game', 'Software') group by c.customer_id ) t2 on c.customer_id = t2pk where t.taxRecord_bracketThreshold in (22, 24, 27, 29) group by t1rp1, t2rp1, c.customer_age, c.customer_balance order by p0, p1 limit 500;
|
||||
1
external/duckdb/benchmark/appian_benchmarks/queries/q08.sql
vendored
Normal file
1
external/duckdb/benchmark/appian_benchmarks/queries/q08.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
select t4rp1 as g0, t5rp1 as g1, sum(creditCard_lastChargeAmount) as p0, min(t6rp1) as p1, sum(t3rp2) as p2 from CreditCardView cc left outer join ( select min(order_id) as t1rp1, creditCard_number as t1pk from CreditCardView cc left outer join OrderView o on cc.creditCard_number = o.order_creditCardNumber where order_slaProbability > 0.125 group by creditCard_number ) t1 on cc.creditCard_number = t1pk left outer join ( select sum(orderItem_weight) as t2rp1, creditCard_number as t2pk from CreditCardView cc left outer join OrderView o on cc.creditCard_number = o.order_creditCardNumber left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId group by creditCard_number ) t2 on cc.creditCard_number = t2pk left outer join ( select min(address_zip) as t3rp1, sum(taxRecord_bracketThreshold) as t3rp2, creditCard_number as t3pk from CreditCardView cc left outer join OrderView o on cc.creditCard_number = o.order_creditCardNumber left outer join CustomerView c on o.order_customerId = c.customer_id left outer join AddressView a on c.customer_id = a.address_customerId left outer join TaxRecordView t on a.address_id = t.taxRecord_addressId group by creditCard_number ) t3 on cc.creditCard_number = t3pk left outer join ( select sum(product_price) as t4rp1, creditCard_number as t4pk from CreditCardView cc left outer join OrderView o on cc.creditCard_number = o.order_creditCardNumber left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId left outer join ProductView p on oi.orderItem_productId = p.product_id where orderItem_weight < 25.0 group by creditCard_number ) t4 on cc.creditCard_number = t4pk left outer join ( select sum(category_regulationProbability) as t5rp1, creditCard_number as t5pk from CreditCardView cc left outer join OrderView o on cc.creditCard_number = o.order_creditCardNumber left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId left outer join ProductView p on oi.orderItem_productId = p.product_id left outer join CategoryView ca on p.product_categoryName = ca.category_name group by creditCard_number ) t5 on cc.creditCard_number = t5pk left outer join ( select min(product_inventoryLastOrderedOn) as t6rp1, creditCard_number as t6pk from CreditCardView cc left outer join OrderView o on cc.creditCard_number = o.order_creditCardNumber left outer join OrderItemView oi on o.order_id = oi.orderItem_orderId left outer join ProductView p on oi.orderItem_productId = p.product_id left outer join CategoryView ca on p.product_categoryName = ca.category_name where product_price < 200.0 group by creditCard_number ) t6 on cc.creditCard_number = t6pk where t1rp1 > 10000 or t2rp1 > 15 or t3rp1 > 20200 group by t4rp1, t5rp1 order by p0, p1, p2 limit 500;
|
||||
Reference in New Issue
Block a user