I have to get the items from a table similar to what I have provided below where the Result and Accuracy don't exist or Null. The table is having a lot of data and it is growing daily. I tried to get the items from the dynamo DB using the scan. But it is taking a lot of time to show the result. Can anyone suggest me how to run the query or scan which will provide me the result faster?
Dynamo DB Table(Sample):
|ID(primary)|date(String)|Result(number)|Accuracy(Number)|
| edfca | 20180101 | 12 | 59.99 |
| yrdfa | 20180109 | 72 | 91.49 |
| arfead | 20180101 | 122 | 32.12 |
| readssda | 20180112 | | |
| geeddar | 20180123 | 3 | 81.11 |
| rogeasa | 20180203 | | |
| swiwads | 20180205 | 32 | 13.12 |
Currently, I'm using the following
java:
ScanSpec scanSpec = new ScanSpec();
scanSpec.withFilterExpression("attribute_not_exists(accuracy)");
scanSpec.setMaxResultSize(100);
table.scan(scanSpec);
The above scan operation is very slow.
I'm new to dynamo DB and I googled it and found it's better to use a query than using the scan operation.
Can I use the query operation for getting the data I need? If yes please provide an example