---
title: "Processing 11 million rows in minutes instead of hours"
url: https://daily.dev/posts/processing-11-million-rows-in-minutes-instead-of-hours-jgagdggzi
source_url: https://stitcher.io/blog/processing-11-million-rows
type: article
source: "stitcher.io"
published: 2026-01-19T14:16:09.599Z
updated: 2026-01-19T14:16:35.447Z
tags: ["performance", "database", "architecture", "php"]
reading_time: 10
upvotes: 276
comments: 4
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Processing 11 million rows in minutes instead of hours

**[stitcher.io](https://daily.dev/sources/stitcher)** · 10 min read · 276 upvotes · 4 comments

## Summary

A developer optimized their blog's analytics system to process 11 million events, improving performance from 30 to 14,000 events per second through systematic changes: removing unnecessary database sorting, reversing nested loops, ditching the ORM for raw queries, replacing closures with while loops, fixing framework serialization overhead, and using indexed ID-based pagination instead of offsets. The rebuild time dropped from 50 hours to 10 minutes per projector.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://stitcher.io/blog/processing-11-million-rows>

## Community discussion

Top comments from developers on daily.dev.

**@fatah7** · 9 upvotes

> ```php
>  // Loop over each projector
> foreach ($projectors as $projector) {
>         // Loop over each event
>         foreach ($storedEvents as $storedEvent) {
>             // …
>         }
>     }
> ```
>
> Although i skim read this, but each time i see nested loop i always wondered is there a way to remove the other loop if each event can be processed to multiple projector why not using concurrency or parallelism (well it's php but still)? just a thought.

**@masiorama** · 2 upvotes

> Intersting article, I digged more into event sourcing after this. Thanks.

**@jack\_starborn** · 0 upvotes

> Impressive. Thx for sharing.

## Similar posts on daily.dev

- [Once again processing 11 million rows, now in seconds](https://daily.dev/posts/once-again-processing-11-million-rows-now-in-seconds-oqf9cnfsn) · stitcher.io · 98 upvotes · 1 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#database](https://daily.dev/tags/database), [#architecture](https://daily.dev/tags/architecture), [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/processing-11-million-rows-in-minutes-instead-of-hours-jgagdggzi)
