forked from feldera/feldera
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'inc_txns' of https://github.com/hydro-project/increment…
…al_tranactions into inc_txns
- Loading branch information
Showing
11 changed files
with
258 additions
and
306 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+786 Bytes
(100%)
incremental_transactions/tpcc/graphs/byname_sql_incremental.rs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
incremental_transactions/tpcc/handles/byname_sql.rs.handles.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(in_warehouse_static, in_warehouse, in_district_static, in_district_next_id, in_district_ytd, in_customer, in_transaction_parameters, out_ncustomers, out_cust_enum, out_cust_agg, out_cust_med, out_cust_med, out_cust_max, out_median_pos) | ||
(in_warehouse_static, in_warehouse, in_district_static, in_district_next_id, in_district_ytd, in_customer, in_transaction_parameters, out_cust_agg, out_cust_byname) |
2 changes: 1 addition & 1 deletion
2
incremental_transactions/tpcc/handles/byname_sql_incremental.rs.handles.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
(in_warehouse_static, in_warehouse, in_district_static, in_district_next_id, in_district_ytd, in_customer, in_transaction_parameters, out_ncustomers, out_cust_enum, out_cust_agg, out_cust_med, out_cust_med, out_cust_max, out_median_pos) | ||
(in_warehouse_static, in_warehouse, in_district_static, in_district_next_id, in_district_ytd, in_customer, in_transaction_parameters, out_cust_agg, out_cust_byname) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,19 @@ | ||
-- Ignoring byname for now | ||
-- if (byname) | ||
-- { | ||
|
||
|
||
-- CREATE VIEW ncustomers AS -- SELECT count(c_id) INTO :namecnt | ||
-- SELECT count(c_id) AS name_cnt -- FROM customer | ||
-- FROM customer AS c, -- WHERE c_last=:c_last AND c_d_id=:c_d_id AND c_w_id=:c_w_id; | ||
-- transaction_parameters as t | ||
-- WHERE c.c_last = t.c_last | ||
-- AND c.c_d_id = t.c_d_id | ||
-- AND c.c_w_id = t.c_w_id; | ||
|
||
-- CREATE VIEW cust_enum AS | ||
-- SELECT c.c_first, c.c_middle, c.c_id, | ||
-- c.c_street_1, c.c_street_2, c.c_city, c.c_state, c.c_zip, | ||
-- c.c_phone, c.c_credit, c.c_credit_lim, | ||
-- c.c_discount, c.c_balance, c.c_since | ||
-- FROM customer AS c, | ||
-- transaction_parameters AS t | ||
-- WHERE c.c_last = t.c_last | ||
-- AND c.c_d_id = t.c_d_id | ||
-- AND c.c_w_id = t.c_w_id | ||
-- ORDER BY c_first; | ||
|
||
CREATE VIEW cust_agg AS | ||
SELECT ARRAY_AGG(c_id ORDER BY c_first) AS cust_array | ||
FROM (SELECT c.c_id, c.c_first | ||
SELECT ARRAY_AGG((c_id + c_w_id + c_d_id) ORDER BY c_first) AS cust_array | ||
FROM (SELECT c.c_id, c.c_w_id, c.c_d_id, c.c_first | ||
FROM customer AS c, | ||
transaction_parameters AS t | ||
WHERE c.c_last = t.c_last | ||
AND c.c_d_id = t.c_d_id | ||
AND c.c_w_id = t.c_w_id | ||
ORDER BY c_first); | ||
|
||
CREATE VIEW cust_med AS | ||
CREATE VIEW cust_byname AS | ||
SELECT c.c_first, c.c_middle, c.c_id, | ||
c.c_street_1, c.c_street_2, c.c_city, c.c_state, c.c_zip, | ||
c.c_phone, c.c_credit, c.c_credit_lim, | ||
c.c_discount, c.c_balance, c.c_since | ||
FROM customer as c, | ||
cust_agg as a, | ||
transaction_parameters as t | ||
WHERE c.c_id = a.cust_array[(ARRAY_LENGTH(a.cust_array) / 2) + 1]; | ||
|
||
-- CREATE VIEW cust_med AS | ||
-- SELECT c.c_first, c.c_middle, c.c_id, | ||
-- c.c_street_1, c.c_street_2, c.c_city, c.c_state, c.c_zip, | ||
-- c.c_phone, c.c_credit, c.c_credit_lim, | ||
-- c.c_discount, c.c_balance, c.c_since | ||
-- FROM cust_agg AS a, | ||
-- cust_enum AS c, | ||
-- transaction_parameters AS t | ||
-- WHERE c.c_id = a.cust_array[FLOOR(ARRAY_LENGTH(a.cust_array) / 2) + 1]; | ||
-- | ||
-- create view cust_max as | ||
-- SELECT c.c_first, c.c_middle, c.c_id, | ||
-- c.c_street_1, c.c_street_2, c.c_city, c.c_state, c.c_zip, | ||
-- c.c_phone, c.c_credit, c.c_credit_lim, | ||
-- c.c_discount, c.c_balance, c.c_since | ||
-- FROM customer AS c, | ||
-- transaction_parameters AS t | ||
-- WHERE c.c_last = t.c_last | ||
-- AND c.c_d_id = t.c_d_id | ||
-- AND c.c_w_id = t.c_w_id | ||
-- AND c_first = (select max(c_first) from customer LIMIT 1) | ||
-- LIMIT 1; | ||
|
||
-- CREATE VIEW cust_max AS | ||
-- SELECT c_first, c_last | ||
-- FROM customer | ||
-- ORDER BY c_first | ||
-- LIMIT 1; | ||
|
||
-- SELECT c_first, c_middle, c_id, | ||
-- c_street_1, c_street_2, c_city, c_state, c_zip, | ||
-- c_phone, c_credit, c_credit_lim, | ||
-- c_discount, c_balance, c_since | ||
|
||
|
||
-- DECLARE c_byname CURSOR FOR | ||
-- SELECT c_first, c_middle, c_id, | ||
-- c_street_1, c_street_2, c_city, c_state, c_zip, | ||
-- c_phone, c_credit, c_credit_lim, | ||
-- c_discount, c_balance, c_since | ||
-- FROM customer | ||
-- WHERE c_w_id=:c_w_id AND c_d_id=:c_d_id AND c_last=:c_last | ||
-- ORDER BY c_first; | ||
|
||
-- CREATE VIEW median_pos AS | ||
-- SELECT c_first, c_middle, c_id, | ||
-- c_street_1, c_street_2, c_city, c_state, c_zip, | ||
-- c_phone, c_credit, c_credit_lim, | ||
-- c_discount, c_balance, c_since | ||
-- FROM cust_last | ||
-- ORDER BY c_first | ||
-- LIMIT 1 OFFSET ( | ||
-- SELECT FLOOR((COUNT(*) - 1) / 2) | ||
-- FROM cust_last | ||
-- ); | ||
|
||
-- OPEN c_byname; | ||
-- | ||
-- if (namecnt%2) namecnt++; --Locate midpoint customer; | ||
-- for (n=0; n<namecnt/2; n++) | ||
-- { | ||
-- EXEC SQL FETCH c_byname | ||
-- INTO :c_first, :c_middle, :c_id, | ||
-- :c_street_1, :c_street_2, :c_city, :c_state, :c_zip, | ||
-- :c_phone, :c_credit, :c_credit_lim, | ||
-- :c_discount, :c_balance, :c_since; | ||
-- } | ||
-- EXEC SQL CLOSE c_byname; | ||
--} | ||
/* | ||
else | ||
{ | ||
EXEC SQL SELECT c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_zip, | ||
c_phone, c_credit, c_credit_lim, | ||
c_discount, c_balance, c_since | ||
INTO :c_first, :c_middle, :c_last, | ||
:c_street_1, :c_street_2, :c_city, :c_state, :c_zip, | ||
:c_phone, :c_credit, :c_credit_lim, | ||
:c_discount, :c_balance, :c_since | ||
FROM customer | ||
WHERE c_w_id=:c_w_id AND c_d_id=:c_d_id AND c_id=:c_id; | ||
} */ | ||
WHERE (c.c_id + c.c_w_id + c.c_d_id) = a.cust_array[(ARRAY_LENGTH(a.cust_array) / 2) + 1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.