0

我有下一个表结构:

SELECT * FROM v WHERE uid = 0x5103be34e695ba3c31000000;

 uid                        | cid       | v
----------------------------+-----------+-------
 0x5103be34e695ba3c31000000 | 02j1Dy9G1 |  True
 0x5103be34e695ba3c31000000 | 03szNx7G1 | False
 0x5103be34e695ba3c31000000 | 0SREjO9G1 |  True
 0x5103be34e695ba3c31000000 | 0bQ4Qn9G1 |  True
 0x5103be34e695ba3c31000000 | 0ojEVLWF1 |  True
 0x5103be34e695ba3c31000000 | 1NiWfO9G1 |  True
 0x5103be34e695ba3c31000000 | 1fSmhWGF1 |  True
 0x5103be34e695ba3c31000000 | 1o0Ri3TF1 |  True

用户 (uid) 喜欢 (True) 或不喜欢 (False) 内容 (cid)

“用户喜欢内容吗?”

SELECT * FROM v WHERE uid = 0x5103be34e695ba3c31000000 AND cid IN ('Rqy9V79J',....more than 2000 cids...);

rpc timeout

Normal SELECT * FROM v WHERE uid = 0x5103be34e695ba3c31000000 works very fast.

如何使用 IN 加快读取请求?其他数据结构?有任何想法吗?

4

1 回答 1

1

具有许多参数的 IN 运算符需要为每个线程提供更多内存。

要修复它,请尝试设置 JVM_OPTS="$JVM_OPTS -Xss512k"

于 2013-08-13T08:32:20.667 回答