redis 可以实现类似mysql的高级排序吗?
PHPz
PHPz 2017-04-21 11:17:15
0
5
1020

redis sort
能做类似
mysql
这样的排序吗?

SELECT id,weight,click FROM task ORDER BY weight DESC, click ASC

PHPz
PHPz

学习是最好的投资!

reply all(5)
伊谢尔伦

Use redis ordered set to sort when inserting

Peter_Zhu

Don’t waste your efforts, no, just sit back and wait. http://redis.io/commands/SORT

黄舟

Use memsql

巴扎黑

It is not supported directly, but you can design it, such as dividing the score into weight + (max_click - click)

Ty80

@finallygo’s method is generally feasible, but if it’s too complicated, it may not be supported well.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template