1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-27 22:58:19 +00:00

Don't use LEFT JOIN unless we have to

This commit is contained in:
Jeremy Ruston 2023-10-27 14:10:30 +01:00
parent a58f119c50
commit e4af21a169

View File

@ -326,7 +326,7 @@ $tw.SqlFunctions = function(options) {
var statementGetShadowSource = self.db.prepare(`
SELECT t.title, t.plugintitle
FROM tiddlers AS t
LEFT JOIN plugins AS p ON t.plugintitle = p.plugintitle
JOIN plugins AS p ON t.plugintitle = p.plugintitle
WHERE t.title = $title AND t.plugintitle <> ''
ORDER BY p.priority DESC
LIMIT 1;
@ -381,7 +381,7 @@ $tw.SqlFunctions = function(options) {
var statementEachTiddler = self.db.prepare(`
SELECT t.title, ti.meta, ti.text
FROM titles AS t
LEFT JOIN tiddlers AS ti ON t.title = ti.title AND t.plugintitle = ti.plugintitle
JOIN tiddlers AS ti ON t.title = ti.title AND t.plugintitle = ti.plugintitle
WHERE t.plugintitle == ''
ORDER BY t.title ${COLLATION_CLAUSE}
`);