推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
QuDump
V2EX  ›  Python

用 flask 搭建论坛 , 数据库查询 是否有必要 Eager Loading ?

  •  
  •   QuDump · Dec 15, 2014 · 3993 views
    This topic created in 4194 days ago, the information mentioned may be changed or developed.
    最近自己在用flask 做论坛玩儿,在sqlalchemy 的文档的时候看到介绍Eager Loading。 说是只通过尽量少的query 把所有相关数据读出来,包括外键的值。 这样在以后用的时候就会减少query的数目。
    所以想请教各位大牛,在实践中这样做是否有必要?
    5 replies    2014-12-16 16:20:36 +08:00
    maga
        1
    maga  
       Dec 15, 2014
    先把功能做出来,再想优化的事情
    awanabe
        2
    awanabe  
       Dec 15, 2014
    用redis解决很多db优化的问题==
    shuson
        3
    shuson  
       Dec 16, 2014
    @maga 我经常被一个师兄这么说
    zhuf
        4
    zhuf  
       Dec 16, 2014
    过早的优化不好
    QuDump
        5
    QuDump  
    OP
       Dec 16, 2014
    @awanabe @maga @zhuf @shuson
    好的,谢谢楼上各位
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   919 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 20:43 · PVG 04:43 · LAX 13:43 · JFK 16:43
    ♥ Do have faith in what you're doing.