google-code-export / marinemap

Automatically exported from code.google.com/p/marinemap
Other
1 stars 2 forks source link

Implement an improved caching strategy for Impact Analysis (Milestone 1.2.1) #359

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Change caching strategy so that it uses a hash of the geometry rather than
the more volatile mpa_id (which changes when an mpa is copied).

Check out the ResultCache model in the intersection app.  
It starts on line 908 of lingcod.intersection.models.  
Hashes the wkt of the geometry and specify that it should be unique
together with the intersection feature.  

Original issue reported on code.google.com by sfletche@gmail.com on 16 Apr 2010 at 12:56

GoogleCodeExporter commented 9 years ago
Created two new models to handle this.  One to cache the impact analysis 
results, the
other to relate the cached mpas to their allowed uses.  This second model will 
be
used to determine whether the allowed uses have changed when accessing the 
cache in
the future.  
The original cache table has been left in the application (and database) so as 
not to
destroy the caching that has taken place already.  Anytime, these cache results 
are
accessed, they will be added to the new cache tables as well.  
Caching is now stored by geometry hash and allowed uses.  When analysis is 
cached,
any other mpa with identical geometry and the same allowed uses will be able to
utilize this cache.  

Original comment by sfletche@gmail.com on 23 Apr 2010 at 11:18