From 8df0273ca800d782129c3f7ee088fc43af8f567a Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 29 Jan 2023 20:17:50 -0500 Subject: [PATCH] more analysis --- analytics/users/paying_users.sql | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/analytics/users/paying_users.sql b/analytics/users/paying_users.sql index 19d71239f9..90053b102c 100644 --- a/analytics/users/paying_users.sql +++ b/analytics/users/paying_users.sql @@ -27,7 +27,7 @@ AND j.created_at > NOW() - interval 7 day GROUP BY u.username ORDER BY use_count desc --- Paid subscribers generating # results +-- Paid subscribers generating results in the last month (with # threshold) select username, use_count FROM ( select u.username, count(*) as use_count @@ -43,7 +43,21 @@ FROM ( GROUP BY u.username ORDER BY use_count desc ) as t -WHERE use_count > 50 +WHERE use_count > 10 + +-- Paid users gennerating results in the last month +select u.username, count(*) as use_count +from users as u + join tts_inference_jobs as j + on u.token = j.maybe_creator_user_token +WHERE u.token IN ( + select distinct user_token + from user_subscriptions + where maybe_stripe_subscription_status NOT IN ("canceled", "incomplete", "incomplete_expired") +) +AND j.created_at > NOW() - interval 1 day +GROUP BY u.username +ORDER BY use_count desc