|Blackfire call graph|
Blackfire tells me that 172 different MySQL queries are being run. The PHP code responsible is using the ORM to build up the joins and so on. I suspect that the problem is that there is pagination being applied and the ORM is not able to optimize the queries it needs to do in order to paginate efficiently.
Okay, so what questions do I have?
Why are we not querying the database more directly? I appreciate that developer productivity is a good reason to use ORM but is it a good reason in this case? 172 queries is an awful lot, especially when a lot of them are related to querying the schema so our ORM can run.
Why on earth does PHP have to spend so much time in disk I/O reading all of those source files when really what we need is request routing, a database query, and a response handler?
reports that 304kb of data was transmitted across the wire for this. That seems like a lot of data for the five or six records that I'm returning to the frontend.
The call graph is frustrating – I'm lumbered with a whole lot of black box code and I have no control over the SQL that is being run. How can I improve the performance of this transaction?