Skip to content

Commit

Permalink
speed up via materialized (#508)
Browse files Browse the repository at this point in the history
PR #504 made the order data sync job very slow. This PR attempts to
address this.
  • Loading branch information
harisang authored Feb 4, 2025
1 parent be8716d commit bc95c8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions queries/orderbook/barn_batch_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ trade_data_processed as (

{{auction_prices_corrections}}

auction_prices_processed as (
auction_prices_processed as materialized (
select
ap.auction_id,
ap.token,
Expand All @@ -107,7 +107,7 @@ auction_prices_processed as (
on ap.auction_id = apc.auction_id and ap.token = apc.token
),

price_data as (
price_data as materialized (
select
tdp.auction_id,
tdp.order_uid,
Expand Down
4 changes: 2 additions & 2 deletions queries/orderbook/order_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ trade_data_processed as (

{{auction_prices_corrections}}

auction_prices_processed as (
auction_prices_processed as materialized (
select
ap.auction_id,
ap.token,
Expand All @@ -132,7 +132,7 @@ auction_prices_processed as (
where s.block_number >= {{start_block}} and s.block_number <= {{end_block}}
),

price_data as (
price_data as materialized (
select
tdp.auction_id,
tdp.order_uid,
Expand Down
4 changes: 2 additions & 2 deletions queries/orderbook/prod_batch_rewards.sql
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ trade_data_processed as (

{{auction_prices_corrections}}

auction_prices_processed as (
auction_prices_processed as materialized (
select
ap.auction_id,
ap.token,
Expand All @@ -107,7 +107,7 @@ auction_prices_processed as (
on ap.auction_id = apc.auction_id and ap.token = apc.token
),

price_data as (
price_data as materialized (
select
tdp.auction_id,
tdp.order_uid,
Expand Down

0 comments on commit bc95c8b

Please sign in to comment.