ssb: Stared at the news feed queries for performance and correctness a bit.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 26m27s

This commit is contained in:
Cory McWilliams 2025-01-15 19:32:31 -05:00
parent a1c4382fde
commit 21788fc7b0
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🦀", "emoji": "🦀",
"previous": "&qe6da4WrU2hQ3nDaZk87SAccuUpGNP5rPCh5P5bRmxk=.sha256" "previous": "&ylIHNCaX9UzGb13pGbe7vqDlypSEuoxIxWzYLELHXXg=.sha256"
} }

View File

@ -86,8 +86,8 @@ class TfTabNewsFeedElement extends LitElement {
JOIN messages_refs ON mine.id = messages_refs.ref JOIN messages_refs ON mine.id = messages_refs.ref
JOIN messages ON messages_refs.message = messages.id JOIN messages ON messages_refs.message = messages.id
WHERE WHERE
mine.timestamp >= ?2 AND messages.timestamp >= ?2 AND
mine.timestamp < ?3 messages.timestamp < ?3
UNION UNION
SELECT * FROM mine SELECT * FROM mine
WHERE WHERE
@ -101,7 +101,7 @@ class TfTabNewsFeedElement extends LitElement {
` `
SELECT id, previous, author, sequence, timestamp, hash, json(content) AS content, signature SELECT id, previous, author, sequence, timestamp, hash, json(content) AS content, signature
FROM messages FROM messages
WHERE id = ?1 WHERE messages.id = ?1
UNION UNION
SELECT id, previous, author, sequence, timestamp, hash, json(content) AS content, signature SELECT id, previous, author, sequence, timestamp, hash, json(content) AS content, signature
FROM messages JOIN messages_refs FROM messages JOIN messages_refs