Start with the question
A dataset can be enormous while the answer you need is tiny. You might have a folder full of events and only want a count by category. The interesting design question is how to get from one to the other without carrying every intermediate value around.
Imagine a modest laptop, a pile of event files, and a single question: which categories occur most often? Before reaching for a bigger machine, sketch the actual work. Which fields are relevant? Which rows can be excluded? What does the final answer look like?
Reduce before collecting
A useful first sketch is to select the fields that matter, apply the relevant filters, and aggregate before handing the result to an interactive notebook. SQL expresses that intent compactly.
The output is a summary. It is the natural place to begin plotting or inspecting. DuckDB is one tool for exploring this style of local analytical work; the specific input format and execution plan still matter.
-- Illustrative query against an existing events table.
SELECT category, COUNT(*) AS event_count
FROM events
WHERE category IS NOT NULL
GROUP BY category
ORDER BY event_count DESC;Keep the working set bounded
The same principle applies outside data analysis. It can be easier to isolate one heavy stage than to move an entire workflow. A local terminal can remain the place where work is coordinated, even when a particular task runs in a cloud notebook.
| Question | Design decision |
|---|---|
| Do I need every field? | Select the columns the analysis uses. |
| Do I need every row? | Apply meaningful filters early. |
| Do I need the entire result in Python? | Inspect a summary or sample first. |
Measure the actual work
When turning the outline into an experiment, record the input size, memory peak, elapsed time, and exact operation. Compare the same task under the same conditions. A smoother workflow is useful; a measurement makes the trade-off explainable.
A clear question, a bounded working set, and an honest measurement are a good starting point. The laptop does not need to hold the whole problem in memory at once for the investigation to move forward.
A small machine is an invitation to be precise about the work.