You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the usage of cache dictionary or complex_cache_dictionary layout.
Sometime we are able to know if a key have been updated, simply because it was inserted in the dictionary source.
Currently to refresh the value in the cache we either need to rely on staling duration of the key or on a SYSTEM RELOAD DICTIONARY. The first one may be more frequent than the key update and suffer from some lag when a key is updated and reloaded in the cache. The second one just remove all what ever they have been updated or not, which slow done incoming queries that must refresh keys values.
I would propose a solution for this : dictInvalidate('dictionary',<keys>) and/or dictRefresh('dictionary',<keys>) functions.
The use case would be to call those function for each individual keys after insertion, with a materialized view or a subsequent select.
In my opinion the dictRefresh version is probably more interesting because it allow to directly and asynchronously reload of the value. While the dictInvalidate would delay the reloading to the query time.
I have an issue with this for classical dictionaries. I'm not sure it's can be applied to those cases. But if it's is possible I also think it could be a nice feature to avoid memory issue while reloading totally big dictionary that could be reload just partially.
I don't use all dictionary layout but we could suppose thoses function to be a noop if it's not applicable, or throw an error.
The text was updated successfully, but these errors were encountered:
With the usage of cache dictionary or complex_cache_dictionary layout.
Sometime we are able to know if a key have been updated, simply because it was inserted in the dictionary source.
Currently to refresh the value in the cache we either need to rely on staling duration of the key or on a
SYSTEM RELOAD DICTIONARY
. The first one may be more frequent than the key update and suffer from some lag when a key is updated and reloaded in the cache. The second one just remove all what ever they have been updated or not, which slow done incoming queries that must refresh keys values.I would propose a solution for this :
dictInvalidate('dictionary',<keys>)
and/ordictRefresh('dictionary',<keys>)
functions.The use case would be to call those function for each individual keys after insertion, with a materialized view or a subsequent select.
In my opinion the
dictRefresh
version is probably more interesting because it allow to directly and asynchronously reload of the value. While thedictInvalidate
would delay the reloading to the query time.I have an issue with this for classical dictionaries. I'm not sure it's can be applied to those cases. But if it's is possible I also think it could be a nice feature to avoid memory issue while reloading totally big dictionary that could be reload just partially.
I don't use all dictionary layout but we could suppose thoses function to be a noop if it's not applicable, or throw an error.
The text was updated successfully, but these errors were encountered: