perf(electron): add index for updates (#6951)
 Above image shows the performance on querying a 20k rows of updates table, which is super slow at 150+ms. After adding index for doc_id the performance should be greatly improved. After:  fix TOV-866
This commit is contained in:
@@ -77,16 +77,16 @@ test('db should be destroyed when app quits', async () => {
|
||||
const db0 = await ensureSQLiteDB(workspaceId);
|
||||
const db1 = await ensureSQLiteDB(v4());
|
||||
|
||||
expect(db0.db).not.toBeNull();
|
||||
expect(db1.db).not.toBeNull();
|
||||
expect(db0.adapter).not.toBeNull();
|
||||
expect(db1.adapter).not.toBeNull();
|
||||
|
||||
existProcess();
|
||||
|
||||
// wait the async `db.destroy()` to be called
|
||||
await setTimeout(100);
|
||||
|
||||
expect(db0.db).toBeNull();
|
||||
expect(db1.db).toBeNull();
|
||||
expect(db0.adapter.db).toBeNull();
|
||||
expect(db1.adapter.db).toBeNull();
|
||||
});
|
||||
|
||||
test('db should be removed in db$Map after destroyed', async () => {
|
||||
|
||||
@@ -51,6 +51,6 @@ test('on destroy, check if resources have been released', async () => {
|
||||
};
|
||||
db.update$ = updateSub as any;
|
||||
await db.destroy();
|
||||
expect(db.db).toBe(null);
|
||||
expect(db.adapter.db).toBe(null);
|
||||
expect(updateSub.complete).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user