Here in the company we have PG and MySql databases, these two banks are networked and identical in structure and data, where a "robot" performs this mirroring between them every 10 minutes.
So far so good ... It turns out now that the bases are getting giant (currently 1170000 rows in a table), and got to a point where MySql can not run any more queries or it takes several minutes. The two banks are absolutely the same (tables, data, structure, relationships, etc). When we perform a query in Pg the return is fast, it is only 4 seconds, but the same query that should return the same amount of data MySql can not answer.I'm referring to a simple query, not Join, for example. Like the following:
SELECT idCdr, agente
FROM 'cdr'
WHERE agente <> ''
GROUP BY agente
HAVING COUNT( agente ) > 1;
This same statement, PG returns me in 3 seconds and MySql takes a few minutes. I have already done tests on the dashboard of the banks themselves (phpMyAdmin and PgAdmin) and it happened the same thing.
Does anyone have an idea of what might be happening?