It turned out that the most egregious problem was a few pages of problems that clogged the database with thousands of SQL queries. The code was relatively innocent looking, only some related to grid data. However, C # / LINQ was too powerful for its own (or ours) own good: if you bind a grid to a table, but the grid wants to display a field from another table linked via a foreign key, it does it! But he does this by executing millionth queries:
SELECT ... FROM other_table WHERE Id = 1 ... SELECT ... FROM other_table WHERE Id = 2 ... SELECT ... FROM other_table WHERE Id = 3 ... SELECT ... FROM other_table WHERE Id = 4 ...
etc., making sure that the data set bound to the control had all the necessary data, without requiring a database, the problems were noticeably weakened.
Now back to the profiling ...
source share