New option for Modis::Model - :enable_all_index by nattfodd · Pull Request #7 · rpush/modis

@nattfodd

Allows to disable creating of my:core:key:all kind of keys if they are not needed.
Getting rid of these keys is important feature, because those keys consume a huge amount of memory
(one single *:all key for 158m records consumes for about of 10GB of ram)
Assuming some people don't use Model.all in their code,
it's important to disable that feature on demand

@nattfodd

… set to false

By default, redis returns emtpy array when the desired key does not exist.
This behavior may mislead a developer, since he just disabled that key to be used.
So instead throw error to bring an attention to it

@nattfodd nattfodd deleted the disable_all_index_on_demand branch

February 26, 2021 14:23

choznerol added a commit to choznerol/rpush that referenced this pull request

Dec 23, 2025
rpush#525 (comment) mentioned that `rpush:notifications:all` wouldn't be cleaned up properly.

In our case, the `rpush:notifications:all` can keep growing to eat up most of our Redis storage (3.7GB out of 5GB in our case)

If we're not using `Rpush::Client::Redis::Notification.all` anywhere, it might be a good idea to just avoid storing `rpush:notifications:all` at all.

Ref for `enable_all_index`:
- https://github.com/rpush/modis?tab=readme-ov-file#all-index
- rpush/modis#7