Actions
Bug #7997
closedUsername and alias exists check too slow
Description
The check to see if a username or alias exists is too slow. With 1 million users this takes 4 seconds or more. Query as follows.
SELECT u.`id` FROM `jos_comprofiler` AS c INNER JOIN `jos_users` AS u ON u.`id` = c.`id` WHERE ( u.`username` = 'test' OR c.`alias` = 'test' ) LIMIT 0, 1
This becomes significantly faster (few milliseconds) if it's broken into 2 queries instead of a join. Needs further testing to find the most optimal query for checking this.
Updated by krileon over 4 years ago
This is exponentially faster.. 100x faster even.. splitting the query into 2 optimized queries. The two queries being combined in a join is only fast if it finds a user.
Updated by krileon over 4 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100
Fixed in MR !1553
Actions