-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* supabase cleanup drop duplicate send_account_created index enable pg_cron create cronjob for deleting send account transfers with no send account created row * add delete send account transfers with no send account * go back to indexing all USDC an SEND token transfers * just filter the rows actually * fix checkout specs to be less flaky
- Loading branch information
Showing
8 changed files
with
130 additions
and
35 deletions.
There are no files selected for viewing
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
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
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
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
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
1 change: 1 addition & 0 deletions
1
supabase/migrations/20240728180824_delete_duplicate_send_account_created_account_index.sql
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
drop index if exists "public"."send_account_created_account"; |
29 changes: 29 additions & 0 deletions
29
supabase/migrations/202407281808278_send_account_transfers_filter_non_send_accounts.sql
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
set check_function_bodies = off; | ||
|
||
-- create trigger function for filtering send_account_transfers with no send_account_created | ||
create or replace function private.filter_send_account_transfers_with_no_send_account_created() | ||
returns trigger | ||
language plpgsql | ||
security definer | ||
as $$ | ||
begin | ||
-- Deletes send_account_transfers with no send_account_created. | ||
-- This is due to performance issues in our shovel indexer and using filter_ref to limit indexing to only | ||
-- send_account_transfers with send_account_created. | ||
-- For now, we index all USDC and SEND token transfers, and use this function filter any send_account_transfers with no send_account_created. | ||
-- See https://github.com/orgs/indexsupply/discussions/268 | ||
if exists ( select 1 from send_account_created where account = new.f ) | ||
or exists ( select 1 from send_account_created where account = new.t ) | ||
then | ||
return new; | ||
else | ||
return null; | ||
end if; | ||
end; | ||
$$; | ||
|
||
-- create trigger on send_account_transfers table | ||
create trigger filter_send_account_transfers_with_no_send_account_created | ||
before insert on public.send_account_transfers | ||
for each row | ||
execute function private.filter_send_account_transfers_with_no_send_account_created(); |
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