0

I have next table structure:

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

User (uid) likes(True) or dislikes(False) content (cid)

"Is content liked by user?"

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.

How can i speed up read request with IN? Other data structure? Any ideas?

Ben Harrison
  • 2,121
  • 4
  • 24
  • 40
Dimetrio
  • 31
  • 2
  • Can you post your full schema (create table statement) including any indexes? – Richard Aug 12 '13 at 13:15
  • How many instances in your cluster? If you have more than one, set consistency to local_quorum and see if you have the same issue. – user1452132 Aug 12 '13 at 15:04

1 Answers1

1

IN-operator with many parameters require more memory for each thread.

To fix it try to set JVM_OPTS="$JVM_OPTS -Xss512k"

Dimetrio
  • 31
  • 2