[英]Django ORM extremely slow
my Database had only 2 rows. 我的数据库只有2行。 and when execute below query. 以及当执行以下查询时。 taken time was about 2 seconds. 耗时约2秒。
start = datetime.datetime.now()
parks=Park.objects.filter(id='test')
end = datetime.datetime.now()
print('parks : '+str(parks))
print('duration : ' + str(end-start))
sql query on mysql command line was 0.1s. mysql命令行上的sql查询为0.1s。 django shell was also fine. django shell也很好。
could you help me my case? 你能帮我解决我的问题吗?
1) Install django debug toolbar https://github.com/jazzband/django-debug-toolbar 1)安装django调试工具栏https://github.com/jazzband/django-debug-toolbar
2) Why are you using a string for an id? 2)为什么要使用字符串作为ID?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.