I have corrected design (that fortunately were not implemented yet) where an API were to make parallel calls to the same table, and after all of them returns, calculate the pagination via combination and math.
I replaced it with an index, it was a pretty straightforward index as well, imagine the pain if the original design was somehow implemented.
I replaced it with an index, it was a pretty straightforward index as well, imagine the pain if the original design was somehow implemented.