|
|
1
2
没有任何内置方式。我写过这个问题 on my blog 以优化访问反向关系的技术。 |
|
|
2
1
大阪, 只需将查询集缓存为python变量即可。
然后在你的for循环中使用学生。 下面是Django自己关于这个特定问题的文档的链接:—) http://docs.djangoproject.com/en/1.1/topics/db/optimization/#understand-cached-attributes |
|
|
3
0
试试这个吧?
http://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.QuerySet.select_related 我从未在其结果中使用过select_related和.all(),因此我不确定它是否会产生db节省。 |
|
|
giantjenga · 优化整数向量到二进制向量的转换 1 年前 |
|
|
Daniel Lobo · 使用约束进行优化 1 年前 |
|
Sergio · python中大量数字的乘法 1 年前 |
|
|
Sergey Dev · 临时表与表变量 1 年前 |
|
|
John · 减少C中的内存消耗++ 1 年前 |