2

When using a PartiQL query which looks like this:

SELECT * FROM my_table WHERE my_field IN [1, 2, 3...]

I received this error which I can't find anywhere in Google and doesn't tell me anything about how to resolve the problem:

DynamoDbException: Too many decomposed read operations for a given query

What do I need to do differently?

Alex
  • 7,639
  • 3
  • 45
  • 58

1 Answers1

5

For WHERE IN queries on a secondary index attribute, there is a limit of 50 items.

I asked AWS and got a response which I will post in case anyone else finds it useful:

This exception is expected when you increase the value in your WHERE IN statement to more than 50. When it passes 50 total, it will throw the error "Too many decomposed read operations for a given query".

NB, this limit only applies for secondary indexes. The limit for primary indexes is 100.

Alex
  • 7,639
  • 3
  • 45
  • 58
  • Thanks for sharing this. I had the same problem, and the limit of 50 works for me. And in my case it happens when I use a primary index, not a secondary one. – RussCoder Jul 16 '23 at 18:24