Server code takes more than 15 seconds to iterate over 1000 rows?

My guess (still a guess, no science here), is that the bottleneck is the row object that acts like a dictionary but does more than a dictionary and has some slow overhead.

Another thing that I often do to speed up database access is to limit the number of tables and columns and use simple object (json) columns.

I only use columns for data that needs to be searched or sorted and put the rest in a simple object column. I also avoid the proliferation of tables like type or status and use a string to represent type or status directly.

These two techniques help keeping the tables simpler, the code shorter and the app faster.

5 Likes