gaiaresources / ala-citizenscience

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

Improve map performance - database access #391

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Even with ~300 records, if the survey even has 1 attribute the map performance 
becomes sluggish. This has several causes but the one looked at here is 
database access.

As we iterate through the returned records to build the kml we access the 
AttributeValues and Attributes associated with a record. Each of these is 
another database query and so slows things down substantially. We don't 
actually need all of this information to draw the points.

Instead, KML should only contain record information (Really - just record ID, 
lat and lon, but we will just flatten the record to keep things simple). 

Detailed record information, the AttributeValues, will be returned when a map 
feature is selected. This minimises our database access substantially.

On my test dataset which has a substantial amount of attributes, the My 
Sightings page had improveds of about 10:1 and Advanced Review had improvements 
of 2:1. Testing was done in Chrome.

Original issue reported on code.google.com by aaron.lo...@gmail.com on 28 Feb 2013 at 5:45