added index to source_ids

This commit is contained in:
zadam
2019-12-01 14:39:24 +01:00
parent 4c07ac4c4c
commit 7ef2e7769f
5 changed files with 149 additions and 114 deletions

View File

@@ -26,7 +26,10 @@ async function load() {
noteTitles = await sql.getMap(`SELECT noteId, title FROM notes WHERE isDeleted = 0 AND isProtected = 0`);
noteIds = Object.keys(noteTitles);
prefixes = await sql.getMap(`SELECT noteId || '-' || parentNoteId, prefix FROM branches WHERE prefix IS NOT NULL AND prefix != ''`);
prefixes = await sql.getMap(`
SELECT noteId || '-' || parentNoteId, prefix
FROM branches
WHERE isDeleted = 0 AND prefix IS NOT NULL AND prefix != ''`);
const branches = await sql.getRows(`SELECT branchId, noteId, parentNoteId FROM branches WHERE isDeleted = 0`);