PaymentTransactionGroup_statPaymentTransactionLineList: Do not use node_category.
node_category adds a join with catalog which tends to be preferred by query optimiser over the agrgegate relation (because there are fewer accounts than there are aggregared documents), which makes displaying a payment group proportional to the number of payments on the accoutns instead of proportional to current group's related aggregate list. Also, drop parent_portal_type condition, as payment lines aggregated to a group should be children of a Payment Transaction (and it saves one more join - although much less costly than the node_category one). Also, make aggregate relation condition strict (there should be no group sub-objects from which we would want to get related aggregates).
Showing
Please register or sign in to comment