perf: use unbuffered_cursor for stock_ageing report (#39399)

perf: use unbuffered_cursor for stock stock_ageing report

Unbuffered cursor lets us load one row at a time in memory from mysql instead of lowing all at once.

This makes it possible to run the report for large number of SLEs.
This commit is contained in:
Ankush Menat 2024-01-16 11:43:35 +05:30 committed by GitHub
parent 82026f780d
commit ed927f102e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,6 +233,8 @@ class FIFOSlots:
"""
stock_ledger_entries = self.sle
with frappe.db.unbuffered_cursor():
if stock_ledger_entries is None:
stock_ledger_entries = self.__get_stock_ledger_entries()