Re: Marker Point Display - Large data set
well it is trivial, create a table called xml_cache that is tag (index)
and text (data), the tag is the unique args that created the output
(lat, long, zoom - whatever you want). Before you go create the XML,
lookup the table on the index (by the tag), if there is a row there,
print that text, and exit. 20ms
if not, create the XML, save it, print it and exit 500ms
if someone adds a point, delete all rows, or if you are supporting
multiple maps like I am, then delete all rows whose tags contain the
map name.
at the moment i just cache everything - even though obviously beyond
the fixed views, nobody is likely to re-use the data - unless they
clicked on a cluster and pick that zoom command, or a locality link -
Anyway, points get added very often so the cache table never gets big.
You can obviously decrease clustering calc time further by limiting the
variety of unique requests in some way - for example, insisting the
user only zoom via cluster links instead of anywhere they want, or
ensuring that the center of each new view is only one of a fixed number
of points.. and so on..
You could also not allow a new point to throw away the cache - just do
like google groups and after placing the new point note that it will
appear "shortly", then time out the cache in X minutes by adding a
timestamp field to the table, so that you are doing the clustering at
the top level very infrequently indeed.
but basically, i don't think I have to worry about those tricks until
the underlying data set goes well past 10,000 points..
btw, don't forget to have an index on lat,long in your point table, so
that selects with a boundary box are not table scans.
0 Comments:
Yorum Gönder
<< Home