Skip to content

Commit

Permalink
Fix slow token delete
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrel-b committed Oct 24, 2023
1 parent 33a547a commit a6cbefb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion db/gen/coredb/token_gallery.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion db/queries/core/token_gallery.sql
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ where
and (sqlc.narg('only_from_user_id') is null or t.owner_user_id = @only_from_user_id)
and (cardinality(@only_from_contract_ids) = 0 or td.contract_id = any(@only_from_contract_ids))
and (cardinality(@only_from_chains::int[]) = 0 or td.chain = any(@only_from_chains))
and t.deleted = false
and ((@remove_holder_status and t.is_holder_token) or (@remove_creator_status and t.is_creator_token))
and t.token_definition_id = td.id
and t.deleted = false
and td.deleted = false
and t.last_synced < @timestamp;

0 comments on commit a6cbefb

Please sign in to comment.