django-computedfields icon indicating copy to clipboard operation
django-computedfields copied to clipboard

minor optimization possible with .only?

Open jerch opened this issue 3 years ago • 1 comments

In theory we know all local fields, that are needed to update a cf, thus could lower the db/ORM/memory stress by only loading those fields with .only.

Needs some investigation, whether the savings are worth the trouble, because there is a nasty downside - if a local field was forgotten in the self-depends rule, the field value gets loaded lazy for every single object, thus runtime might explode again for bigger changesets.

jerch avatar Apr 27 '22 13:04 jerch

This is also linked to the issue, that we currently dont have any measures in place to enforce dependency strictness between depends and the function. Also see https://github.com/netzkolchose/django-computedfields/issues/135#issuecomment-1787104107.

jerch avatar Oct 31 '23 14:10 jerch