mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-17 11:03:11 -06:00
Add comments about queries
This commit is contained in:
parent
28690b72f9
commit
ab80cea3d1
|
|
@ -99,6 +99,8 @@ const bulkSelectStateForHistoryVisibilitySQL = `
|
|||
AND (event_type_nid = 7 OR event_state_key LIKE '%:' || $2);
|
||||
`
|
||||
|
||||
// bulkSelectMembershipForHistoryVisibilitySQL is an optimization to get membership events for a specific user for defined set of events.
|
||||
// Returns the event_id of the event we want the membership event for, the event_id of the membership event and the membership event JSON.
|
||||
const bulkSelectMembershipForHistoryVisibilitySQL = `
|
||||
SELECT re.event_id, re2.event_id, rej.event_json
|
||||
FROM roomserver_events re
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ const selectRecentEventsSQL = "" +
|
|||
" AND ( $7::text[] IS NULL OR NOT(type LIKE ANY($7)) )" +
|
||||
" ORDER BY id DESC LIMIT $8"
|
||||
|
||||
// selectRecentEventsForSyncSQL contains an optimization to get the recent events for a list of rooms, using a LATERAL JOIN
|
||||
// The sub select inside LATERAL () is executed for all room_ids it gets as a parameter $1
|
||||
const selectRecentEventsForSyncSQL = `
|
||||
WITH room_ids AS (
|
||||
SELECT unnest($1::text[]) AS room_id
|
||||
|
|
|
|||
Loading…
Reference in a new issue