Yii2 Active Record vs Query Builder for Reports
When to use Query Builder versus Active Record in Yii2 for reporting queries, with a comparison table, trade-offs, and a monthly sales report example.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
When to use Query Builder versus Active Record in Yii2 for reporting queries, with a comparison table, trade-offs, and a monthly sales report example.
MariaDB 10.2+ window functions replace brittle self-joins for running totals and top-N-per-group queries. A worked example shows ROW_NUMBER() and SUM() OVER with explicit framing, plus EXPLAIN checks to catch temporary-table spills before production.