V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
271.61D
573.91D
V2EX  ›  Python

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

  •  
  •   Livid ·
    PRO
    · Apr 25, 2012 · 2959 views
    This topic created in 5126 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   ·   Solana   ·   5657 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 09:03 · PVG 17:03 · LAX 02:03 · JFK 05:03
    ♥ Do have faith in what you're doing.