Download & Extend

Call aggregation function in a single query

Project:Views Calc
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Currently when you enable paging and add e.g. SUM and COUNT, views_calc executes 4 additional queries.
Namely:
current-page-SUM
current-page-COUNT
total-SUM
total-COUNT

Regarding SQL we could limit to two queries:
current-page-SUM+COUNT
total-SUM+COUNT

If multiple aggregation functions enabled, we will waste less performance.

Comments

#1

Status:active» needs review

Attached patch fundamentally changes the queries.

It only executes ONE query per subtotal and ONE query per page.
All aggregation functions are packed into one query - if any.

Already committed to dev since i consider it stable and clean.
Open for discussion to decide if we definitively stay on that.

AttachmentSize
views_calc_1037118_1_singlequery.patch 9.15 KB
nobody click here