V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
kenneth
V2EX  ›  Python

如何批量更新一个10w条记录的数据库?求思路。。。

  •  
  •   kenneth · 2012-12-01 22:23:04 +08:00 · 3916 次点击
    这是一个创建于 4170 天前的主题,其中的信息可能已经有所发展或是发生改变。
    测试数据10w条记录都通过抓取得来,能否通过Twisted长连接,监测有没有更新?
    通过gevent来异步更新数据?
    还是通过python-rq让队列来批量更新mysql中的数据?
    求思路?
    5 条回复    1970-01-01 08:00:00 +08:00
    picasso250
        1
    picasso250  
       2012-12-01 23:50:37 +08:00
    将纪录划分成N份,摘要之?

    纯粹抛砖引玉。
    lonelybug
        2
    lonelybug  
       2012-12-01 23:56:24 +08:00
    分批量更新,每次1000条之类的。
    dreampuf
        3
    dreampuf  
       2012-12-02 00:27:38 +08:00
    10W这种量级,一条SQL,你问完了,也就跑完了。
    songpengf117
        4
    songpengf117  
       2012-12-02 10:19:19 +08:00
    重新抓取10W记录,要多长时间?
    picasso250
        5
    picasso250  
       2012-12-03 14:08:09 +08:00
    楼上问的问题貌似蛮重要的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   782 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 20:19 · PVG 04:19 · LAX 13:19 · JFK 16:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.