İçeriğe geç

Büyük Sonuç Parçalanmamış (ARCH3062)

Anahtar typescript.orm.large-result-not-chunked · Önem info · Kategori orm

Tüm büyük sonuç kümesini belleğe yükleyip üzerinde gezmek, milyonlarca satırı aynı anda RAM’de tutabilir. Bir streaming/chunked cursor API mevcutsa onu kullanın.

const all = await eventRepo.find(); // milyonlarca satır belleğe
for (const e of all) {
await process(e);
}
const stream = await eventRepo.createQueryBuilder('e').stream();
for await (const e of stream) {
await process(e);
}

Büyük kümeleri stream/chunk/find_each gibi parçalı bir cursor API ile işleyin.