Django DB Query Terms

I am trying to compare the speed of several different requests that return the same thing on Django 1.4 using Postgres. Unfortunately, if I use:

import logging l = logging.getLogger('django.db.backends') l.setLevel(logging.DEBUG) l.addHandler(logging.StreamHandler()) 

Two equivalent or similar queries end up being deferred to the Query cache. Anyway, can I clear this cache or is it better to compare the speed of two requests?

+4
source share
1 answer

For my analysis, I used something like this:

 from django import db for query in db.connections['default'].queries: print query, query['time'] 
+2
source

Source: https://habr.com/ru/post/1492229/


All Articles