Cloud concept · Updated

Full Table Scan - A full table scan is a read operation that traverses an entire table instead of using a key or index to read only matching records.

In short

A full table scan examines a table across its storage partitions or pages and may filter out most of the records it reads. It can be efficient when a workload needs most of the table, but using it for a selective lookup can increase latency, consume read capacity, and interfere with other workloads.

Cloud Concepts Hub →

5 key aspects of Full Table Scan

Judge a full scan by what it reads, when that work is cheaper than an indexed path, and how it affects capacity and consistency.

01
Read scope versus result size

A scan can read a large table and return very few records. Compare rows or bytes read with rows returned to distinguish storage work from result size.

02
Key and index alternatives

Use a primary key, secondary index, or partition-prunable predicate when a frequent request targets a small subset. Choose index keys around the lookup and range conditions the application actually uses.

03
When scanning is efficient

A scan can be the least expensive path for a small table or a query that needs most rows. An index can cost more when the engine must follow many index entries back to the base table.

04
Pagination and parallelism

Follow continuation tokens to complete a paginated scan, even when a filtered page is empty. Limit parallel workers to protect foreground traffic; more workers can reduce elapsed time without reducing total read work.

05
Consistency and snapshots

Check whether the store guarantees freshness for individual reads, a stable snapshot for the whole scan, or neither. Use a point-in-time view when a job must reconcile counts or records while writes continue.

Cloud services for Full Table Scan

These services expose the same read-scope decision in different ways. DynamoDB makes the choice explicit through Scan and Query, while the database engines in Amazon RDS and Azure SQL Database let the optimizer choose a path that engineers can inspect. BigQuery illustrates why row coverage and bytes read are separate measures: a query can cover every row but read only a few columns.

In a system that combines operational and analytical stores, use key-based reads for selective application requests and run recurring whole-dataset analysis against a separate analytical copy when freshness requirements allow it. That keeps broad scans from competing with latency-sensitive traffic.

Amazon DynamoDBAmazon DynamoDB

The Scan operation traverses a table or secondary index over one or more requests; a filter expression is applied after items are read and does not reduce read capacity consumed. Query instead requires a partition-key value and can narrow the read with a sort-key condition. A strongly consistent Scan on a base table does not provide snapshot isolation for the operation.

Amazon RDSAmazon RDS

Database engines hosted on Amazon RDS can choose a table scan instead of an index path. For example, in RDS for PostgreSQL, EXPLAIN can show a Seq Scan, and EXPLAIN ANALYZE executes the query and reports actual row counts and timing.

Azure SQL Database

Azure SQL Database execution plans distinguish a Table Scan on a heap from a Clustered Index Scan on a clustered table. Inspect predicates and rows read in the actual plan to see how much data a scan accessed.

What is Full Table Scan

2 min read

A full table scan is an access path, not a description of the result. A query that returns only three orders can still scan the entire orders table if the engine cannot use a key, index, or partition boundary to locate those orders. In a relational database, the optimizer can choose this path even when an index exists. In a key-value or document store, the application may explicitly request a scan, while a separate lookup or query operation uses key conditions to limit what it reads.

For example, an order-history endpoint that lists recent orders for one customer should use an access path keyed by customer ID and ordered by timestamp. That lets the database read the customer's date range instead of scanning all orders and filtering by customer afterward. If the table is keyed only by order ID, a secondary index can provide the customer-and-time access path, at the cost of extra storage and write work. In a partitioned store, a high-cardinality partition key helps distribute traffic when requests are spread across key values, but it does not make an unrelated attribute searchable or prevent a particularly busy key from becoming hot.

A filter only saves scan work when the engine can use it to skip storage or change the access path. A filter applied after reading reduces the result set, not the amount read. Likewise, a result limit or a small page does not guarantee a cheap lookup: the engine may have to examine many records to find enough matches. Some scan APIs can return an empty page with a continuation token because none of the records read for that page passed the filter. For a complete scan, continue until the token is absent, not until a page is empty.

Full scans are appropriate for small tables, bulk validation, or aggregates that need most records. Sequential or parallel reads can be cheaper than following an index and fetching a large share of the table one record at a time. In columnar systems, scanning all rows does not necessarily mean reading all columns: selecting only the needed columns can reduce bytes read, while partition pruning can avoid reading portions of the table altogether.

Before running a large scan, inspect the query plan or scan metrics and compare records or bytes read with results returned. For background jobs on a live store, bound concurrency and read rate; parallel scans can finish sooner but may raise peak load without reducing total work. Verify read consistency separately from scan scope. Strong per-record reads do not necessarily give a point-in-time view across pages while writes continue. If reconciliation requires a stable view, use a snapshot-capable read or a point-in-time export supported by the store.

Full Table Scan exam questions

Real practice exam questions on Full Table Scan, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C03

A media company runs a one-time audit to find assets in an Amazon DynamoDB table that are missing a rights classification. The audit job calls Scan with a FilterExpression that uses attribute_not_exists on the classification attribute. In a test run, the job finishes without reporting any assets, even though several assets in the table lack the attribute. The final response processed by the job has Count equal to 0, ScannedCount greater than 0, and a nonempty LastEvaluatedKey. How should the developer change the job to ensure it inspects the entire table?

Show answerCORRECT ANSWER

Use LastEvaluatedKey as ExclusiveStartKey for the next Scan request, even when Count is 0. Continue until the response has no LastEvaluatedKey.

DynamoDB applies the filter after reading each page. A page can contain no matching items even when the scan has not reached the end of the table. LastEvaluatedKey lets the job resume after the items already evaluated.

Practice Full Table Scan in a full exam

Questions on Full Table Scan in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn Full Table Scan in lessons

2 short lessons on Full Table Scan in 1 certification course.

Open the lessons