3 ms·
In iommi we built something imo much smarter: https://docs.iommi.rocks/en/latest/dev_tools.html#sql-trace https://docs.iommi.rocks/en/latest/dev_tools.html#sql-
by boxed 2y ago
In iommi we built something imo much smarter: https://docs.iommi.rocks/en/latest/dev_tools.html#sql-trace https://docs.iommi.rocks/en/latest/dev_tools.html#sql-trace
The idea is that:
1. We store all the stack traces and SQL calls
2. At the end of the request we group them to find N+1
3. If there are any N+1 (given some threshold), we print a big warning to stdout. Full traceback for one of the SQL calls and a few examples of SQL.
This is imo MUCH better. It means the console is silent when there is no issue. It also means the console is loud when there IS an issue. And the output you get is very helpful.
This approach is better than the one in the article, and superior to Django Debug Toolbar where you have to actively go look for problems instead of the machine telling you.