Analytical vs. Transactional Workloads
OLTP keeps a business running; OLAP helps it understand itself. Why analytical workloads scan columns while transactional ones touch rows — and why that distinction shapes DuckDB.
The difference you met on the last page has a formal name. The "needle" work applications do is called OLTP — Online Transaction Processing. The "net" work analysts do is OLAP — Online Analytical Processing. You do not need to memorize the acronyms, but understanding what each workload demands explains why analytical databases like DuckDB are built so differently from the database behind a typical app.
A transaction vs. an analysis
A transaction is a small, complete unit of business activity: place an order, transfer money, update an address. It touches a few rows, must be fast, and must be safe even if thousands happen at once.
An analysis is the opposite in almost every dimension: it reads a huge slice of history and condenses it into understanding.
A simple way to remember it: OLTP records what happened; OLAP explains what it means. Every order an OLTP system saves becomes a row that, much later, an OLAP query sweeps up to find a trend.
Why the physical shape differs: rows vs. columns
Here is the idea that ties everything together — and the reason DuckDB feels fast for analysis. Databases can store a table in two ways.
- Row storage keeps all of a row's values together. Perfect for OLTP: "give me everything about order #4821" reads one contiguous chunk.
- Column storage keeps all values of one column together. Perfect
for OLAP: "average
amountover 10 million orders" reads just theamountcolumn and skips everything else.
When an analytical query only needs amount, a column store reads
only the amounts — not the ids, dates, or regions sitting beside them.
On a wide table that can mean reading 5% of the data instead of 100%.
That single design choice is why purpose-built analytical engines crush
row-oriented databases on summary queries. DuckDB is column-oriented,
which is a big part of why DuckDB exists (more on that soon).
You write SQL the same way either way
Reassuringly, you do not change your SQL to get these benefits. You
write the same SELECT ... GROUP BY you already know; the engine's
storage layout does the rest. The lesson is not "write different SQL for
OLAP" — it is "the questions you ask, and the engine you ask them on,
are tuned for analysis."
The query below is a perfectly ordinary GROUP BY. What makes it
"analytical" is the intent — summarizing a column across many rows — not
any special syntax.
Five thousand rows in, four rows out. The query never needed id or
order_date, so a column store would never read them.
A side-by-side summary
| Dimension | OLTP (transactional) | OLAP (analytical) |
|---|---|---|
| Typical operation | Insert / update / point read | Large aggregating read |
| Rows touched per query | A few | Thousands to billions |
| Columns touched | Most of the row | A few of many |
| Best storage layout | Row-oriented | Column-oriented |
| Acceptable latency | Milliseconds | Seconds |
| Concurrency | Many users at once | Few analysts at once |
| Goal | Run the business | Understand the business |
This course lives entirely on the OLAP side of that table.
Check your understanding
What does OLAP stand for, and what is it for?
Online Transaction Processing — recording day-to-day business events.
Online Analytical Processing — summarizing large amounts of data to understand it.
Offline Logical Archive Processing — backing up old data.
Open Ledger Accounting Protocol — a finance standard.
Why does a column-oriented store make analytical queries faster?
It compresses rows so transactions commit faster.
A query that needs only a few columns can read just those columns and skip the rest of each row.
It guarantees every query touches every column.
It removes the need to write GROUP BY.
A query that scans five million orders to report monthly revenue is best described as:
An OLTP transaction, because it touches the orders table.
An OLAP analytical workload, because it reads many rows to produce a small summary.
Invalid, because analytical queries cannot read order data.
A backup operation.
Next: how analysts actually reason about a dataset they have never seen before — the mental moves behind exploratory analysis.
Analytics vs. Application Development
The same SQL keywords serve two very different jobs. Understanding the difference between application SQL and analytical SQL is the foundation of everything that follows.
Thinking in Datasets
How analysts reason about large datasets they cannot see all at once — the mental moves of exploratory data analysis, and how SQL turns questions into answers.