0Pricing
AWS Security Academy · Lesson

Partitioning Logs for Speed and Cost

Organize data so investigations run faster and cost less.

The Cost of Scanning

Because Athena charges by data scanned, querying a year of logs to find one day's events wastes money and time. Partitioning is the technique that lets Athena read only the relevant slice of data, making queries dramatically faster and cheaper. It is the single most important Athena optimization.

What a Partition Is

A partition divides a table's data by the values of one or more columns, usually date components, mapped to S3 prefixes. CloudTrail logs are already laid out by region/year/month/day, so partitioning by these matches the physical structure and lets Athena skip folders that fall outside your query.

All lessons in this course

  1. Querying S3 Logs with Athena
  2. Building Tables Over CloudTrail Data
  3. Investigating Incidents with SQL Queries
  4. Partitioning Logs for Speed and Cost
← Back to AWS Security Academy