Skip to content

Instantly share code, notes, and snippets.

View rhoerr's full-sized avatar

Ryan Hoerr rhoerr

View GitHub Profile
@rhoerr
rhoerr / create_aggregated_eav_views.sql
Last active May 15, 2025 15:11
MySQL views to aggregate Magento 2 EAV data -- requires MySQL 5.7+ or equivalent
/**
* Create aggregated SQL views for default EAV entity types in Magento:
* - dev_category
* - dev_product
* - dev_customer
* - dev_address
*
* Each view has the primary entity table, plus associated EAV values (eav_int, eav_text, etc).
* This is meant as a development tool to quickly see or select scoped data for a given entity.
* Do not use these for any runtime code, and be careful about how many rows you fetch at once.