Some queries still use "timestamp" function instead of "posting_datetime". In my instance single stock entry cancel ends with request timeout. Using "posting_datetime" field directly improves the situation.
cont: https://github.com/frappe/erpnext/pull/46293
(cherry picked from commit ddbb44c6a2)