Added query for state_group_events with room names
parent
3ee19bb8f8
commit
cf737bd22b
|
@ -8,15 +8,6 @@ pg_size_pretty
|
||||||
(1 row)
|
(1 row)
|
||||||
```
|
```
|
||||||
## Show top 20 larger rooms by state events count
|
## Show top 20 larger rooms by state events count
|
||||||
this is old and not working
|
|
||||||
```
|
|
||||||
SELECT r.name, s.room_id, s.state_events
|
|
||||||
FROM room_stats s
|
|
||||||
LEFT JOIN room_names r USING (room_id)
|
|
||||||
ORDER BY ts DESC, state_events DESC
|
|
||||||
LIMIT 20;
|
|
||||||
```
|
|
||||||
maybe, in 2020-4-14 this is:
|
|
||||||
```
|
```
|
||||||
SELECT r.name, s.room_id, s.current_state_events
|
SELECT r.name, s.room_id, s.current_state_events
|
||||||
FROM room_stats_current s
|
FROM room_stats_current s
|
||||||
|
@ -25,7 +16,15 @@ SELECT r.name, s.room_id, s.current_state_events
|
||||||
LIMIT 20;
|
LIMIT 20;
|
||||||
```
|
```
|
||||||
|
|
||||||
and by state_group_events count _(join removed for performance reasons)_:
|
and by state_group_events count:
|
||||||
|
```
|
||||||
|
SELECT 's.room_id', count('s.room_id') cnt, 'rs.name' FROM state_groups_state s
|
||||||
|
LEFT JOIN room_stats_current rs USING (room_id)
|
||||||
|
GROUP BY s.room_id
|
||||||
|
ORDER BY count(s.room_id) DESC
|
||||||
|
LIMIT 20;
|
||||||
|
```
|
||||||
|
plus same, but with join removed for performance reasons:
|
||||||
```
|
```
|
||||||
SELECT s.room_id, count(s.room_id) FROM state_groups_state s
|
SELECT s.room_id, count(s.room_id) FROM state_groups_state s
|
||||||
GROUP BY s.room_id
|
GROUP BY s.room_id
|
||||||
|
|
Loading…
Reference in New Issue