mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +01:00
mini optimizations
This commit is contained in:
@@ -264,7 +264,7 @@ async function findExistencyIssues() {
|
||||
branches.parentNoteId,
|
||||
branches.noteId
|
||||
HAVING
|
||||
COUNT(*) > 1`,
|
||||
COUNT(1) > 1`,
|
||||
async ({noteId, parentNoteId}, autoFix) => {
|
||||
if (autoFix) {
|
||||
const branches = await repository.getEntities(
|
||||
@@ -636,11 +636,11 @@ async function showEntityStat(name, query) {
|
||||
}
|
||||
|
||||
async function runDbDiagnostics() {
|
||||
await showEntityStat("Notes", `SELECT isDeleted, count(noteId) FROM notes GROUP BY isDeleted`);
|
||||
await showEntityStat("Note revisions", `SELECT isErased, count(noteRevisionId) FROM note_revisions GROUP BY isErased`);
|
||||
await showEntityStat("Branches", `SELECT isDeleted, count(branchId) FROM branches GROUP BY isDeleted`);
|
||||
await showEntityStat("Attributes", `SELECT isDeleted, count(attributeId) FROM attributes GROUP BY isDeleted`);
|
||||
await showEntityStat("API tokens", `SELECT isDeleted, count(apiTokenId) FROM api_tokens GROUP BY isDeleted`);
|
||||
await showEntityStat("Notes", `SELECT isDeleted, count(1) FROM notes GROUP BY isDeleted`);
|
||||
await showEntityStat("Note revisions", `SELECT isErased, count(1) FROM note_revisions GROUP BY isErased`);
|
||||
await showEntityStat("Branches", `SELECT isDeleted, count(1) FROM branches GROUP BY isDeleted`);
|
||||
await showEntityStat("Attributes", `SELECT isDeleted, count(1) FROM attributes GROUP BY isDeleted`);
|
||||
await showEntityStat("API tokens", `SELECT isDeleted, count(1) FROM api_tokens GROUP BY isDeleted`);
|
||||
}
|
||||
|
||||
async function runChecks() {
|
||||
|
||||
Reference in New Issue
Block a user