We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Advanced Django queries optimization

Formale Metadaten

Titel
Advanced Django queries optimization
Alternativer Titel
Django queries optimization
Serientitel
Anzahl der Teile
132
Autor
Lizenz
CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
Collecting data from multiple Models is a common flow in Django development. In most of the cases prefetch_related and select_related do all of the job for optimizing the queries. When the models structure become complicated enough and we've put our logic for collecting these items in models' properties we suddenly cannot use prefetch_related or select_related anymore. Our View 's queries count depends on selected items count with high complexity. The problem is in the selection logic: we've implemented an algorithm which calculates something and we cannot prefetch or select all of the objects. So this talk's purpose is: To show how to use Django ORM to move the selection logic, the calculations, the aggregations over group of objects from our python code to our database and moving all of the logic for this in one place - the queryset and test it easily.