erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

Performance Enhancement for get_item_price function in apps/erpnext/erpnext/stock/get_item_details.py

Open aakvatech opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. When the database grows with large number of transactions, constant pulling of item price from DB causes significant unnecessary overload. Using cached values would be a much better approach here if available.

Describe the solution you'd like Instead of the current SQL Query, it would be great to use query builder on get_item_price function so that the performance overhead can be avoided by using cache.

Describe alternatives you've considered Considering that it is a single table query, a simple get_cached_value would have sufficed and the filters could be prepared as well.

Additional context Running saving of sales invoice transactions in a high volume, high concurrency environment causing too many locks waits while it keeps using the same disk where the database is residing.

aakvatech avatar Dec 14 '22 20:12 aakvatech