Show last 100 messages from needed user
parent
48b071d260
commit
7a9cff60e6
|
@ -81,6 +81,17 @@ SELECT user_id, SUM(total_events)
|
|||
LIMIT 20;
|
||||
```
|
||||
|
||||
## Show last 100 messages from needed user, with room names:
|
||||
```
|
||||
SELECT e.room_id, r.name, e.event_id, e.type, e.content, j.json FROM events e
|
||||
LEFT JOIN event_json j USING (room_id)
|
||||
LEFT JOIN room_stats_state r USING (room_id)
|
||||
WHERE sender = '@LOGIN:example.com'
|
||||
AND e.type = 'm.room.message'
|
||||
ORDER BY stream_ordering DESC
|
||||
LIMIT 100;
|
||||
```
|
||||
|
||||
## Show top 20 larger tables by storage size
|
||||
```
|
||||
SELECT nspname || '.' || relname AS "relation",
|
||||
|
|
Loading…
Reference in New Issue