A grain with state writes its whole state on every save. For a quote with ten line items that is a few hundred bytes, and it never changes much. For the quote index from lesson 4.5.3, which knows every quote of an office, it is a time bomb: It grows with every quote, and every new quote rewrites the whole index.
This lesson begins with a field report, measures the problem in a lab and then rebuilds the index so that it can grow with the data without a write growing along with it.
A field report
From our own workshop, without names: A system kept a queue of drafts that a person was supposed to review in the state of a single grain. At the beginning there were a few dozen entries. After a few months there were 22,000, 7.7 MB of JSON altogether, and every change to a single entry wrote all 7.7 MB. From one evening on, every change ran into the timeout after 30 seconds. The database, one of the smallest tiers in Azure, wrote for half an hour at the limit of its log, and other services that used the same database failed along with it.
No single step was wrong. The grain processed one command after the other and saved after each, just as lesson 4.5.3 demands. What was wrong was only that the state grew with the data.