Added example: Show top 20 rooms by new events count in last
parent
35b648609b
commit
9b8cc17cb1
|
@ -64,6 +64,13 @@ device_lists_stream - 326903
|
|||
user_directory_search - 316433
|
||||
```
|
||||
|
||||
## Show top 20 rooms by new events count in last 1 day:
|
||||
```
|
||||
SELECT e.room_id, r.name, COUNT(e.event_id) cnt FROM events e
|
||||
LEFT JOIN room_stats_state r USING (room_id)
|
||||
WHERE e.origin_server_ts >= DATE_PART('epoch', NOW() - INTERVAL '1 day') * 1000 GROUP BY e.room_id, r.name ORDER BY cnt DESC LIMIT 20;
|
||||
```
|
||||
|
||||
## Show top 20 users on homeserver by sent events (messages) at last month:
|
||||
```
|
||||
SELECT user_id, SUM(total_events)
|
||||
|
|
Loading…
Reference in New Issue