Django Queryset 执行慢?
log_queryset = logs.objects.all()
for log in log_queryset ():
...
得到 queryset 后真正执行时, 大约要 5 秒钟, 数据库才
10000
条数据, 查询太慢了...
请教怎么破?
「最上川」
9 years, 3 months ago
Answers
理论上不可能那么慢。
看看这个
http://stackoverflow.com/questions/4222176/why-is-iterating-through-a-large-django-queryset-consuming-massive-amounts-of-me
加个db级别的cache
_昙天_
answered 9 years, 3 months ago