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
I don't know yet Nette\Database details.
The idea is just that some models can have a default ordering (I assume this functionality is present in Nette\Database also).
And that some ORM may still add this ordering in the SQL query whilst it is not needed because only a single object will be prefetched per instance of the original result set.
On very big prefetches I noticed a gain of 10 - 15 %,
since the rest of the DB query is mainly an index scan.
#ClimateChangeBrake
Can someone please dump the queries of such prefetches and see if the bug is present in Nette\Database ?
If so submitting a PR should not be too hard.
I will try to help.
But right now, I start by warning the frameworks/ORM I am aware of :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
Recently I found a problem with Django and submitted a patch in a PR:
https://code.djangoproject.com/ticket/35309
django/django#17984
I also developped a work-around for old versions of Django:
https://github.com/LLyaudet/django-monkey-patches/blob/main/src/django_monkey_patches/django__orm__prefetch_without_useless_order_by.py
I don't know yet Nette\Database details.
The idea is just that some models can have a default ordering (I assume this functionality is present in Nette\Database also).
And that some ORM may still add this ordering in the SQL query whilst it is not needed because only a single object will be prefetched per instance of the original result set.
On very big prefetches I noticed a gain of 10 - 15 %,
since the rest of the DB query is mainly an index scan.
#ClimateChangeBrake
Can someone please dump the queries of such prefetches and see if the bug is present in Nette\Database ?
If so submitting a PR should not be too hard.
I will try to help.
But right now, I start by warning the frameworks/ORM I am aware of :)
Best regards,
Laurent Lyaudet
Beta Was this translation helpful? Give feedback.
All reactions