Granularity defines the atomic unit of analysis for any table or report.
Before writing any query, you must know what real-world event one single row corresponds to.
High granularity data is often described as fine-grained, while aggregated data is coarse-grained.
In web analytics, fine-grained data logs every single button click with a precise millisecond timestamp.
Coarse-grained data summarises those clicks into total daily page visits per country.
Fine detail provides maximal flexibility because you can calculate any higher level summary you need.
You can group hourly readings into daily, weekly, or annual aggregates using simple sums and averages.
However, high granularity comes with high storage costs and slower query execution across billions of rows.
Coarse data is compact and fast to query, but permanently discards individual variation and outliers.
If you only store monthly totals, you can never discover whether sales spiked on rainy weekends.
A frequent modelling blunder is joining two tables that operate at different levels of granularity.
Joining a daily customer table to an item-level order table duplicates customer rows and distorts totals.
Always document the grain of a table in its metadata so analysts understand its scope.
When designing pipelines, preserve fine raw data in cheap storage before aggregating for dashboards.
Getting the granularity right ensures that your data can answer both broad trends and specific investigations.