INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: SQL Server recovery and analytics data

Athena scanned bytes and S3 costs: compare equivalent results

Compare scans and other charges only after matching the business result. Separate columns from partitions and relate bytes read to the report produced.

What you will learn

Separate columns from partitions and relate bytes read to the report produced.

Prerequisite

This fictional measurement assumes scan-based Athena SQL pricing. No current prices or live queries are used.

Measure scans and storage separately

With scan-based Athena SQL pricing, the amount of data scanned affects the charge. Consider S3 storage and requests separately.

Compare scans for an equivalent result
Compare scans for an equivalent result1: Business question — Fix the output conditions — Layout. 2: Layout — Observe bytes read — Data scanned. 3: Data scanned — Add separate costs — Cost view123Business questionLayoutData scannedCost viewCompare scans for an equivalent result1: Business question — Fix the output conditions — Layout. 2: Layout — Observe bytes read — Data scanned. 3: Data scanned — Add separate costs — Cost view123BusinessquestionLayoutData scannedCost view
  1. Business question → LayoutFix the output conditions
  2. Layout → Data scannedObserve bytes read
  3. Data scanned → Cost viewAdd separate costs
Business question
Same day and columns
Layout
Date partitioning and columnar data
Data scanned
Different volumes for the same result
Cost view
Separate scan and storage

Explain the drop from 40 GB to 2 GB

Fictional measurements for the same daily order count with matching results.
Layout and queryScannedWhat changed
Unpartitioned CSV40 GBData outside the target day can be read
Date-partitioned CSV with date filter8 GBMatching partitions are selected
Date-partitioned Parquet with required columns2 GBColumn and layout effects
Keep both versions temporarilySeparate from scansS3 storage can grow during migration

A partition condition limits partitions read. Columnar formats can reduce the columns read. The reduction from 40 GB to 2 GB for the same result is 95%.

Compare measurements under matching conditions

Choose the measurements. Record bytes scanned, frequency, wait time, S3 storage and S3 requests separately.

Change conditions deliberately. Keep the date filter the same while comparing format and projection. Compare counts and computed values.

Include all ongoing work. Account for conversion and temporary copies. A reduction in one query’s scans is not the total cost reduction.

Check the worked example

Choose an option to see the result and explanation.

How much did scanned volume decline from 40 GB to 2 GB?
Read the answer and reason

Answer: 95% · Divide 38 GB by the original 40 GB.

What changes when both versions remain temporarily?
Read the answer and reason

Answer: Check S3 storage volume and duration · Storage can change independently of scans.

What do you fix before comparing two layouts?
Read the answer and reason

Answer: Date, query conditions and output · The comparison must produce the same business result.

Check, then explain in your own words

  1. Fix equivalent output conditions.
  2. Distinguish selected partitions and columns.
  3. Assess Athena and S3 cost components separately.
Check your understanding: Does a 95% scan reduction reduce total cost by 95%?

Compare storage, requests, conversions and query frequency in the complete cost model.

95% applies to bytes read in this trial.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.