mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
f94d7b0bfc
The :only_changes filter re-seeked each journal's predecessor in every EXISTS branch (~7 LATERAL lookups per row). A CTE now shadows the journals table, exposing predecessor_id/predecessor_data_id once per row, and each branch reads those columns instead. On a 703-journal work package this cuts the COUNT from ~1.13M to ~35K shared buffers.