Cascading settings result in N+1
The cascading settings framework has child objects read values from parent objects. It also allows parent objects to override child object values by "locking" the value of a setting.
This behavior is looked up in real-time and is not cached, which means that it results in an N+1 whenever the value of the setting on a child object is "read"
To work around this issue we could:
- Actually cascade the value of the parent object to the child objects so that the value is always being read directly from the child rather than joining to the parent
- Improve the SQL efficiency of the
define_attr_reader
method in theCascadingNamespaceSettings
/CascadingProjectSettings
modules - Cache the value in Redis