mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-31 23:47:51 +00:00
query improvement, fixes
This commit is contained in:
1 parent
40a88bb04e
commit
ab549ab284
1 file changed
+12
-6
@@ -6,19 +6,25 @@
|
||||
select m.token, m.title, m.ietf_language_tag, r.use_count from (
|
||||
select model_token, count(*) as use_count
|
||||
from tts_results
|
||||
where created_at < now() - interval 30 day
|
||||
where created_at > ( CURDATE() - INTERVAL 30 DAY )
|
||||
group by model_token
|
||||
order by use_count desc
|
||||
limit 100
|
||||
) as r
|
||||
join tts_models as m
|
||||
on m.token = r.model_token;
|
||||
|
||||
-- All models by use count, last 5 days
|
||||
select m.token, m.title, m.ietf_language_tag, r.use_count from (
|
||||
-- Most models by use count, last n days
|
||||
-- Limited due to tmux scrollback.
|
||||
select m.token, m.title, m.ietf_language_tag, u.username, r.use_count from (
|
||||
select model_token, count(*) as use_count
|
||||
from tts_results
|
||||
where created_at < now() - interval 5 day
|
||||
where created_at > ( CURDATE() - INTERVAL 5 DAY )
|
||||
group by model_token
|
||||
order by use_count desc limit 100
|
||||
) as r
|
||||
join tts_models as m
|
||||
on m.token = r.model_token;
|
||||
on m.token = r.model_token
|
||||
join users as u
|
||||
on u.token = m.creator_user_token
|
||||
order by r.use_count desc
|
||||
limit 500;
|
||||
Reference in new issue
Block a user