I am trying to trace a query that causes our server to exhaust 85% of the CPU.
The query I found in profiler is:
SELECT COUNT(*) FROM table where foreignId = ? and isActive = ?
so I tried to navigate in the codebase where this query is.
I tried searching:
SELECT COUNT(*) FROM table where foreignId =
- I found two occurrence, but I can't find anything that hasand isActive = value
.FROM table where foreignId = value and isActive = value
- I also found two occurrence, but noCOUNT(*)
from the raw query. However, I can see that after the query, there is a$query->rowCount()
being executed.
My question is.
For #2, does $query->rowCount()
perhaps being captured as SELECT COUNT(*) FROM table where foreignId = ? and isActive = ?
in the database profiler?