推荐学习书目
› 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
Livid
396.81D
539.36D
V2EX  ›  Python

如何在 Storm 里实现随机排序呢?

  •  
  •   Livid ·
    PRO
    · Apr 25, 2012 · 3241 views
    This topic created in 5266 days ago, the information mentioned may be changed or developed.
    在官方网站的文档里搜索 random 居然没有结果。
    2 replies  •  1970-01-01 08:00:00 +08:00
    fanzeyi
        1
    fanzeyi  
       Apr 25, 2012
    实践证明.. 通过 ORM 的 random 是很不靠谱的。。

    在 SQLAlchemy 的时候用过一次 random .. 结果发现每次在跑 random 的时候 MySQL 服务器的负载就会达到一个很不靠谱的地步..

    所以我觉得还是先 count 然后再 random id 吧……
    fanzeyi
        2
    fanzeyi  
       Apr 25, 2012
    擦 我错了.. 没看到是随机排序.. 无视我吧
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2389 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:26 · PVG 19:26 · LAX 04:26 · JFK 07:26
    ♥ Do have faith in what you're doing.