v0.4.15
Added
magento2-performance-audit:references/database-query-profiling.mddocuments a
core-Magento pattern wherecatalog_product_entity_tier_price/catalogrule_product_price
fire once per displayed product on category pages, traced initially (wrongly) to a
project's own pricing plugin — the plugin is structurally identical to core's own
BasePrice::getValue(). The real mechanism:Layer\Category\CollectionFilter's default
addFinalPrice()setstier_priceto a scalar/NULLfrom the price index, which fails
TierPrice::getStoredTierPrices()'sis_array()check regardless, and
catalog_rule_priceisn't in that join's columns at all. Confirmed on a vanilla install
(same scaling, 9–24/page) — the count gap wascatalog/frontend/grid_per_pagebeing
~2x, not a code difference. Includes the "diff anaroundplugin against core before
naming it root cause" rule and thehasData()-based batch-load fix.magento2-performance-audit:references/code-level-patterns.mdadds two short
false-positive callouts to the existing N+1/collection-counting patterns (aForm
vs.GridDataProvider matching the N+1 grep is usually one row, not a scaling bug; a
count($collection->getItems())after an earlierforeachon the same instance is
free, not a live query) and a new "Batch-Preload Plugins Must Stay FPC-Safe" section —
anySessionManagerInterface-backed session (customer, checkout/quote, not just
customer group) read inside a batch-preload plugin on a listing block risks starting a
session for anonymous FPC-cached traffic; readHttp\Contextinstead, the same
Vary-cookie signal core's own FPC-safe price code uses.
Fixed
- The first draft of both entries above ran long (884 words prose vs. this hub's ~170–220
word house style for a single lesson) — cut narrative restatement of the correction,
kept the mechanism, the two verification checks, and the fix code.
Full Changelog: v0.4.14...v0.4.15