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
Your tool seems fantastic to me, but in order to optimize data access through the django ORM, I miss a report on the number of queries that are repeated, since this may be indicative of not having used a select related, prefetch related , or some mistake such as a queryset within a for loop.
I have been using django-queryinspect https://github.com/dobarkod/django-queryinspect, which has been very useful for this purpose, but silk provides many other interesting tools, the ideal would be to have the best of both worlds.
As an advance in terms of analysis, I have seen how it could be carried out using a fork and / or a contribution, but I have been limited by the fact that the SQLQuery#query attribute already has the SQL formatted with the parameters already evaluated (usually ids), which makes it difficult to detect repeated queries. For example, if we have stored:
SELECT * FROM foo WHERE id = 42
SELECT * FROM foo WHERE id = 43
It makes it more difficult to detect repeated queries than if we had stored (in another attribute of the SQLQuery object for example), the query without evaluating:
SELECT * FROM foo WHERE id =?
SELECT * FROM foo WHERE id =?
Before thinking on my own a solution to this need, I would like to know what your opinion is about this feature. Thank you!
The text was updated successfully, but these errors were encountered:
Your tool seems fantastic to me, but in order to optimize data access through the django ORM, I miss a report on the number of queries that are repeated, since this may be indicative of not having used a select related, prefetch related , or some mistake such as a queryset within a for loop.
I have been using django-queryinspect https://github.com/dobarkod/django-queryinspect, which has been very useful for this purpose, but silk provides many other interesting tools, the ideal would be to have the best of both worlds.
As an advance in terms of analysis, I have seen how it could be carried out using a fork and / or a contribution, but I have been limited by the fact that the
SQLQuery#query
attribute already has the SQL formatted with the parameters already evaluated (usually ids), which makes it difficult to detect repeated queries. For example, if we have stored:It makes it more difficult to detect repeated queries than if we had stored (in another attribute of the
SQLQuery
object for example), the query without evaluating:Before thinking on my own a solution to this need, I would like to know what your opinion is about this feature. Thank you!
The text was updated successfully, but these errors were encountered: