Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Slow plugin loading query #8183
reported by @hypeJunction:
SELECT e.*, plugin_oe.*, r.id FROM elgg_entities e JOIN elgg_private_settings ps on ps.entity_guid = e.guid JOIN elgg_objects_entity plugin_oe on plugin_oe.guid = e.guid JOIN elgg_entity_relationships r on r.guid_one = e.guid WHERE ps.name = 'elgg:internal:priority' AND (r.relationship = 'active_plugin' AND r.guid_two = '1') AND ((e.type = 'object' AND e.subtype IN (2))) AND (e.site_guid IN (1)) AND ((1 = 1) AND (e.enabled = 'yes')) ORDER BY CAST(ps.value as unsigned), e.guid
It's the slowest performing query of all. Much worse than any metadata/annotation query (and there are some heavy ones with 6-10 joins).
Not sure if we should just load all plugins with their private settings in one go, and sort in php?
referenced this issue
Apr 12, 2015
It could be the case. I suppose we need to do some benchmarking.