document-dataply 0.0.12 → 0.0.14-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +14 -4
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -11458,6 +11458,7 @@ var IndexManager = class {
|
|
|
11458
11458
|
this.fieldToIndices.get(field).push(indexName);
|
|
11459
11459
|
}
|
|
11460
11460
|
}
|
|
11461
|
+
const perIndexCapacity = Math.floor(this.api.options.pageCacheCapacity / Object.keys(this.api.indices).length);
|
|
11461
11462
|
for (const indexName of targetIndices.keys()) {
|
|
11462
11463
|
if (metadata.indices[indexName]) {
|
|
11463
11464
|
const tree = new import_dataply3.BPTreeAsync(
|
|
@@ -11467,7 +11468,10 @@ var IndexManager = class {
|
|
|
11467
11468
|
this.api.txContext,
|
|
11468
11469
|
indexName
|
|
11469
11470
|
),
|
|
11470
|
-
this.api.comparator
|
|
11471
|
+
this.api.comparator,
|
|
11472
|
+
{
|
|
11473
|
+
capacity: perIndexCapacity
|
|
11474
|
+
}
|
|
11471
11475
|
);
|
|
11472
11476
|
await tree.init();
|
|
11473
11477
|
this.trees.set(indexName, tree);
|
|
@@ -11509,6 +11513,7 @@ var IndexManager = class {
|
|
|
11509
11513
|
}
|
|
11510
11514
|
this.fieldToIndices.get(field).push(name);
|
|
11511
11515
|
}
|
|
11516
|
+
const perIndexCapacity = Math.floor(this.api.options.pageCacheCapacity / Object.keys(this.api.indices).length);
|
|
11512
11517
|
const tree = new import_dataply3.BPTreeAsync(
|
|
11513
11518
|
new DocumentSerializeStrategyAsync(
|
|
11514
11519
|
this.api.rowTableEngine.order,
|
|
@@ -11516,7 +11521,10 @@ var IndexManager = class {
|
|
|
11516
11521
|
this.api.txContext,
|
|
11517
11522
|
name
|
|
11518
11523
|
),
|
|
11519
|
-
this.api.comparator
|
|
11524
|
+
this.api.comparator,
|
|
11525
|
+
{
|
|
11526
|
+
capacity: perIndexCapacity
|
|
11527
|
+
}
|
|
11520
11528
|
);
|
|
11521
11529
|
await tree.init();
|
|
11522
11530
|
this.trees.set(name, tree);
|
|
@@ -11937,9 +11945,10 @@ var MutationManager = class {
|
|
|
11937
11945
|
batchInsertData.push([item.pk, { k: item.pk, v: indexVal }]);
|
|
11938
11946
|
}
|
|
11939
11947
|
}
|
|
11948
|
+
const initMaxSize = 5e4;
|
|
11940
11949
|
const initChunkSize = Math.min(
|
|
11941
|
-
|
|
11942
|
-
Math.max(
|
|
11950
|
+
initMaxSize,
|
|
11951
|
+
Math.max(initMaxSize, Math.floor(batchInsertData.length / 100 * 5))
|
|
11943
11952
|
);
|
|
11944
11953
|
const chunker = new DeadlineChunker(initChunkSize);
|
|
11945
11954
|
await chunker.processInChunks(batchInsertData, async (chunk) => {
|
|
@@ -11950,6 +11959,7 @@ var MutationManager = class {
|
|
|
11950
11959
|
});
|
|
11951
11960
|
const res = await treeTx.commit();
|
|
11952
11961
|
if (!res.success) {
|
|
11962
|
+
await treeTx.rollback();
|
|
11953
11963
|
throw res.error;
|
|
11954
11964
|
}
|
|
11955
11965
|
}
|
package/package.json
CHANGED