Skip to content

Commit

Permalink
fix: add time filter for last 14 days to prevent memory spilling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
senyor-kodi committed Nov 25, 2024
1 parent 8a3786d commit 209054a
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
)
}}

{% set project_start_date = '2023-02-03' %}
{% set project_start_date = '2023-02-03' %}
{% set dev_start_date = "date_trunc('day', now() - interval '14' day)" %}

WITH swap_via_stake AS (
SELECT
Expand All @@ -38,7 +39,7 @@ WITH swap_via_stake AS (
{% if is_incremental() %}
AND {{incremental_predicate('call_block_time')}}
{% else %}
AND call_block_time >= TIMESTAMP '{{project_start_date}}'
AND call_block_time >= {{dev_start_date}}
{% endif %}
),

Expand Down Expand Up @@ -66,7 +67,7 @@ prefund_swap_via_stake AS (
{% if is_incremental() %}
AND {{incremental_predicate('call_block_time')}}
{% else %}
AND call_block_time >= TIMESTAMP '{{project_start_date}}'
AND call_block_time >= {{dev_start_date}}
{% endif %}
),

Expand Down Expand Up @@ -94,7 +95,7 @@ stake_wrapped_sol AS (
{% if is_incremental() %}
AND {{incremental_predicate('call_block_time')}}
{% else %}
AND call_block_time >= TIMESTAMP '{{project_start_date}}'
AND call_block_time >= {{dev_start_date}}
{% endif %}
),

Expand Down Expand Up @@ -126,7 +127,7 @@ withdraw_deposit AS (
{% if is_incremental() %}
AND {{incremental_predicate('w.call_block_time')}}
{% else %}
AND w.call_block_time >= TIMESTAMP '{{project_start_date}}'
AND w.call_block_time >= {{dev_start_date}}
{% endif %}
),

Expand Down Expand Up @@ -169,7 +170,7 @@ token_amounts AS (
{% if is_incremental() %}
AND {{incremental_predicate('ic.block_time')}}
{% else %}
AND ic.block_time >= TIMESTAMP '{{project_start_date}}'
AND ic.block_time >= {{dev_start_date}}
{% endif %}
)

Expand Down

0 comments on commit 209054a

Please sign in to comment.