QueryStore caches every query that comes through the pipeline (this is to maintain a strict 1-1 between SQL Strings & QueryStores to prevent extra work)
We should start to trim from the cache once it gets to a certain size, to make sure that we don't explode users' memory.
There have been a few prototypes of this feature, but the gist of it is:
Modify the create command to schedule a cache trim before creating the new Query
Cache Trim should have some max score, and if the total score of all queries in the cache is greater than the max, start removing the oldest queries from the cache until it falls beneath the max
Some considerations to be made:
We might want to keep track of if a Query currently has any non-internal subscriptions (e.g. parents subscribe to children, but we can safely prune those children - if a user is subscribed, we shouldn't prune it)
How aggressively do we want to trim the cache? Too high and memory usage continues to be high, too low and queries will get recalculated frequently
This also needs to be reflected on the new SDK Query, which is set to be included in an upcoming release
QueryStore
caches every query that comes through the pipeline (this is to maintain a strict 1-1 between SQL Strings & QueryStores to prevent extra work)We should start to trim from the cache once it gets to a certain size, to make sure that we don't explode users' memory.
There have been a few prototypes of this feature, but the gist of it is:
create
command to schedule a cache trim before creating the new QuerySome considerations to be made:
This also needs to be reflected on the new SDK Query, which is set to be included in an upcoming release