Brendiem / ala-citizenscience

Automatically exported from code.google.com/p/ala-citizenscience
0 stars 1 forks source link

Advanced review sightings performance is poor #271

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to the advanced review sightings page.
2. Note that it takes several (usually 6 or more) seconds to return the records 
from the AJAX query.

What is the expected output? What do you see instead?
I would expect it to be faster.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by chris.go...@gmail.com on 24 May 2012 at 11:15

GoogleCodeExporter commented 9 years ago
Some investigation reveals the primary performance issue is caused by the use 
of the PortalPersistentImpl.flatten() method.
The problem with this method, in particular with the Record class, is that the 
Record object contains many lazily loaded associations which the flatten method 
dutifully loads and traverses while serialising the results.  This results in 
10s to 100s of database calls during a single query on the advanced review 
screen.

Original comment by chris.go...@gmail.com on 24 May 2012 at 11:17

GoogleCodeExporter commented 9 years ago
Added a new parameter to the PersistentImpl.flatten to allow selection of the 
properties to be included.
Changed the AdvancedReviewSightingsController to only flatten properties needed 
by the table.

Original comment by chris.go...@gmail.com on 26 May 2012 at 12:10

GoogleCodeExporter commented 9 years ago
Reopening because the main record query is still pretty slow in some cases.  
Specifically, it does a couple of joins that are not required for most queries 
that can result in the number of rows returned being multiplied by a lot 
(10-20x for a couple of our sites) then having to do a lot of work to return 
distinct records.

Original comment by chris.go...@gmail.com on 30 May 2012 at 4:39

GoogleCodeExporter commented 9 years ago
reviewed and accepted

Original comment by aaron.lo...@gmail.com on 31 May 2012 at 1:50

GoogleCodeExporter commented 9 years ago

Original comment by chris.go...@gmail.com on 31 May 2012 at 3:55