Fix slow query for a student accessing the People page
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Doris Tam | ||
20.04 |
Fix Released
|
High
|
Unassigned | ||
20.10 |
Fix Released
|
High
|
Unassigned | ||
21.04 |
Fix Released
|
High
|
Unassigned |
Bug Description
This item fixes the issue with the query run as a student when accessing the People page initially. Once loaded the page handled the data dynamically in the background without any issues.
--
Explain analyse SELECT COUNT(u.id) FROM usr u LEFT OUTER JOIN usr_account_
-------
Finalize Aggregate (cost=31657803.
-> Seq Scan on usr u (cost=0.
Filter: ((id <> 0) AND (id <> 43543) AND (active = 1) AND (deleted = 0) AND (SubPlan 1))
Rows Removed by Filter: 5831
SubPlan 1
-> Result (cost=0.00..1068.60 rows=47496 width=8) (actual time=0.002..4.988 rows=26305 loops=53226)
-> Seq Scan on usr_institution (cost=0.00..1068.60 rows=47496 width=8) (actual time=0.001..3.047 rows=26305 loops=53226)
Planning Time: 0.158 ms
Execution Time: 337495.376 ms
With the fix:
Explain analyse SELECT COUNT(u.id) FROM usr u LEFT OUTER JOIN usr_account_
-------
Finalize Aggregate (cost=4188.
-> Gather (cost=4188.
Workers Planned: 1
Workers Launched: 1
-> Partial Aggregate (cost=3188.
-> Parallel Hash Join (cost=1083.
...
Changed in mahara: | |
status: | Confirmed → Won't Fix |
status: | Won't Fix → In Progress |
Changed in mahara: | |
importance: | Medium → High |
no longer affects: | mahara/21.10 |
Hi Tim,
Thank you for reporting the problem and providing a patch. We'll add it into our code review system.
If you send me your email address, we can make sure to attribute the fix correctly. My email address should be visible in my Launchpad profile.
Thank you
Kristina