Skip to content

Commit

Permalink
Additional indexes for referredBy/created + last_mining_ended_at for …
Browse files Browse the repository at this point in the history
…husky#69.
  • Loading branch information
ice-myles committed Aug 8, 2024
1 parent 9939d44 commit 82b8190
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions users/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ CREATE INDEX IF NOT EXISTS users_shared_referral_lookup_v2_ix ON users (last_min
WHERE mining_boost_level = 0
AND verified = TRUE
AND verified_t1_referrals = 0;
CREATE INDEX IF NOT EXISTS users_referred_by_created_at_ix ON users (referred_by, created_at DESC);
CREATE INDEX IF NOT EXISTS users_last_mining_ended_at_ix ON users (last_mining_ended_at DESC NULLS LAST);

CREATE OR REPLACE FUNCTION before_update_on_users()
RETURNS TRIGGER AS $$
Expand Down

0 comments on commit 82b8190

Please sign in to comment.