1

I searched around but didn't find any answers so posting the question here.

I am setting up a new DB, and trying to compare the performance of Dynamo DB SCAN operation and the SQL WHERE clause (both without creating indexes.)

I understand that the DynamoDB SCAN operations can get super slow as the data grows as it has to go through all the records to get the desired results but isn't the SQL WHERE clause also scans the entire table to get the desired results?

So, Does it mean that Dynamo DB SCAN operation performance is more or less the same as of the SQL WHERE clause performance or SCAN is slower because of all the hashing that it needs to do for primary keys?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Vivek Kumar
  • 419
  • 4
  • 12
  • [possible duplicate](https://stackoverflow.com/questions/13966368/aws-mysql-rds-vs-aws-dynamodb) – Atul Kumar Apr 19 '19 at 04:44
  • Oversimplified but the main difference is: When scanning a DynamoDB table you get all its content back and have to filter on client side whereas with an SQL-compatible database you can use the WHERE-clause to filter data on server side before it gets sent back to your client. – Dunedan Apr 19 '19 at 05:52

1 Answers1

0

SQL WHERE clause also scans the entire table to get the desired results?

Only if it absolutely has to.

Most times, one or more indexes will exist that help narrow down the records an RDBMS needs to read. The DB will might even build one on the fly.

Whereas Dynamo will always read every record when using SCAN()

If you have lots (any?) ad-hoc queries...Dynamo is not for you.

This is a nice reference slide from AWS Summit lecture Iron Triangle of Purpose (PIE Theorem)

Entire video is worth watching... Matching the Database to the Workload

Charles
  • 21,637
  • 1
  • 20
  • 44