Our users where complaining that HelpSpot was running slow. I did some investigating and it wasn’t a consistent slowness at any particular function, but most problems were around sending emails or displaying the initial admin.php screen.
I monitored the database server and found that a query was occurring quite often (every few minutes?) and was consuming 100% of a CPU on our PostgreSQL instance:
SELECT “xRequest” FROM “HS_Request_History” WHERE “tNote” ILIKE $1 AND “tNote” ILIKE $2
(This was retrieved via "select * from pg_stat_activity where usename = ‘helpspot’ " which unfortunately doesn’t show me the values of $1 and $2.).
We have 1.7 million rows in our HS_Request_History table, so I can understand it being slow, especially if this is a wildcard search.
However, I don’t know what function is causing this particular search to occur. A full-text search from the “Data Search” tab seems to use a different query (involving a score and sorting by date).
Question: Do you know which part of HelpSpot would be generating the above tNote LIKE query?