Originally from the User Slack
@Chris_Spence: Hello, I have a question regarding a limit to the parameters for a WHERE…IN(x,y,z)
I am getting an error regarding a cartesian product being over a limit of 100.
Unexpected Exception: All 6 node(s) tried for the query failed (showing first 3 nodes, use getAllErrors() for more): Node(endPoint=/<redacted>): [com.datastax.oss.driver.api.core.servererrors.ServerError: clustering-key cartesian product size 105 is greater than maximum 100],
It is a very simple query and a simple table
Table is similar to
table(
id text,
ColumnA text,
ColumnB set<text>,
ColumnC list<text>,
PRIMARY KEY (id)
);
and the query SELECT id, ColumnA, ColumnB, ColumnC FROM table WHERE id IN (x, y, z ….)
There are 105 strings in the array for the where clause so that matches the errors message above. I’ve not come across any published limit to an IN clause for scylla or cassandra and compared to SQL it seems very low I would expect to be able to pass a lot more values in an IN
clause. An example of the value passed is E7E5079CC9444E4B8AC6FD00981B3DDB
strings all of uniform size.
Can you help point me in the right direction to resolve this or explain what is causing the issue or if this is expected behaviour please?
Thank you
@Marko_Ćorić: you can set for example max_clustering_key_restrictions_per_query : 250
via configuration, but it’s better to review your database scheme.
ofc, that required full cluster restart
@Chris_Spence: Thanks @Marko_Ćorić if it is an expected limit then we will review the schema and re-organise data. Thanks