From c14073f06dad9b78c47efba6100c1e675687dea3 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 14 Jul 2023 10:57:47 -0400 Subject: [PATCH] new queries --- _sql/actions/w2l_inference_jobs.sql | 6 ++++++ _sql/analytics/users/user_registrations.sql | 11 +++++++++++ 2 files changed, 17 insertions(+) create mode 100644 _sql/analytics/users/user_registrations.sql diff --git a/_sql/actions/w2l_inference_jobs.sql b/_sql/actions/w2l_inference_jobs.sql index d7d38244b4..59cc490aef 100644 --- a/_sql/actions/w2l_inference_jobs.sql +++ b/_sql/actions/w2l_inference_jobs.sql @@ -17,3 +17,9 @@ update w2l_template_upload_jobs set status='dead' where status='pending' and download_url LIKE '%tiktok%'; + + +-- Kill all pending jobs +update w2l_template_upload_jobs +set status='dead' +where status IN ('pending', 'started', 'attempt_failed'); diff --git a/_sql/analytics/users/user_registrations.sql b/_sql/analytics/users/user_registrations.sql new file mode 100644 index 0000000000..c47d09edb4 --- /dev/null +++ b/_sql/analytics/users/user_registrations.sql @@ -0,0 +1,11 @@ +-- noinspection SqlDialectInspectionForFile +-- noinspection SqlNoDataSourceInspectionForFile +-- noinspection SqlResolveForFile + +-- All users +select count(*) from users; + +-- Users registered in the last year +select count(*) +from users +where created_at > ( CURDATE() - INTERVAL 365 DAY )