Analysis of paying subscribers

This commit is contained in:
Brandon Thomas committed 2023-02-12 02:40:11 -05:00
1 parent 7efb65ae08
commit 107d11f0f9
3 files changed
+43 -2

No files matched your search

+5 -2
View File
@@ -48,11 +48,14 @@ select
m.ietf_language_tag,
m.title,
u.username,
r.use_count
r.use_count,
m.created_at,
m.user_deleted_at,
m.mod_deleted_at
from (
select model_token, count(*) as use_count
from tts_results
where created_at > ( CURDATE() - INTERVAL 5 DAY )
where created_at > ( CURDATE() - INTERVAL 12 HOUR )
group by model_token
) as r
join tts_models as m
@@ -0,0 +1,38 @@
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
-- noinspection SqlResolveForFile
-- The most popular models amongst paying subscribers.
-- This should give us insight as to which models subscribers pay us for.
SELECT *
FROM (
SELECT
t.token,
t.title,
count(*) as use_count,
t.text_pipeline_type,
t.ietf_language_tag,
t.created_at,
t.user_deleted_at,
t.mod_deleted_at
FROM
tts_inference_jobs as j
JOIN
tts_models as t
ON
t.token = j.model_token
WHERE j.maybe_creator_user_token IN
(
select distinct user_token
from user_subscriptions
)
AND
j.created_at > ( CURDATE() - INTERVAL 1 MONTH )
GROUP BY t.token
ORDER BY use_count DESC
) as x
WHERE
x.use_count > 10;