Skip to content

Commit 458c5f2

Browse files
committed
The schema migration backfillRemoteDocumentStoreDocumentType took 2096 ms (2 seconds) which is WAYYYY too long
1 parent 7a5e876 commit 458c5f2

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

packages/firestore/src/local/indexeddb_schema_converter.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,29 @@ export class SchemaConverter implements SimpleDbSchemaConverter {
300300

301301
if (fromVersion < 19 && toVersion >= 19) {
302302
p = p.next(() => {
303-
createRemoteDocumentStoreDocumentTypeIndex(txn);
304-
return backfillRemoteDocumentStoreDocumentType(simpleDbTransaction);
303+
{
304+
const startTime = performance.now();
305+
console.log(
306+
'zzyzx createRemoteDocumentStoreDocumentTypeIndex starting'
307+
);
308+
createRemoteDocumentStoreDocumentTypeIndex(txn);
309+
console.log(
310+
'zzyzx createRemoteDocumentStoreDocumentTypeIndex completed: elapsedTime:',
311+
performance.now() - startTime
312+
);
313+
}
314+
{
315+
const startTime = performance.now();
316+
console.log('zzyzx backfillRemoteDocumentStoreDocumentType starting');
317+
return backfillRemoteDocumentStoreDocumentType(
318+
simpleDbTransaction
319+
).next(() => {
320+
console.log(
321+
'zzyzx backfillRemoteDocumentStoreDocumentType completed: elapsedTime:',
322+
performance.now() - startTime
323+
);
324+
});
325+
}
305326
});
306327
}
307328

0 commit comments

Comments
 (0)