Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional indexes for referredBy/created + last_mining_ended_at for husky#69 #209

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading