Your API works perfectly today.

Then six months later, your transaction table grows from 10,000 records to 10million records.

Suddenly, requests that once took 80ms now takes 4seconds.

The question is:

Did you choose the right pagination strategy?