On Thu, Jan 9, 2014 at 4:43 PM, Sells, Fred
<
fred....@adventistcare.org> wrote:
>
> Fred: I was unclear. The initial join is 10000 x 1000 x 20 x 100 ... which gets reduced to about 1000 records. A few records are changed every second.
are the 'interesting' 1000 out-records always the same, or changing
slowly? is it easy to test if any specifc in-record alters the result
or not?
if yes on both, then you might invert the calculation, from a 'pull'
method (the current) to a 'push', where you keep the result
precalculated and on each modification you test if it's worthwhile to
redo it.
this assumes:
A.- the process is expensive to do every time for every client (that's
the problem)
B.- it's cheap to verify if the new data alters the result (my initial
questions)
C.- the queries are frequent enough that few precalcs would be unseen.
(i guess so given the number of clients and rate of queries)
if condition C doesn't hold, but B does, then another thing to try:
- on each query, first check if the answer is already precalculated.
if it is, just get that
- if it's not, do the job and store in the cache
- on each input modification, check if it alters the result. if so,
just delete the cache.
finally, if condition B doesn't hold, just store the result in a cache
entry that expires in a minute. that means that the process would
occur at most once a minute and the clients could get results that are
at most a minute old.
--
Javier