I have Master and slave replication using Maria DB I connected to slave DB and executed a query which is a slow query, but that slow query logged in both master and slave slow query logs
Asked
Active
Viewed 711 times
1 Answers
1
No. The Master and the Slave(s) each have a slowlog (if turned on). They record only slow queries from the same machine.
Furthermore, queries that are replicated will not show up in the Slave slowlog unless you turn ON log_slow_slave_statements
. I recommend doing this.
I also recommend turning OFF log_queries_not_using_indexes
; it clutters the slowlog while providing only minimal useful info.
The default long_query_time = 10
leaves the slowlog virtually useless; crank that down to 2 or 1.
For help with slow queries, see http://mysql.rjweb.org/doc.php/mysql_analysis#slow_queries_and_slowlog

Rick James
- 135,179
- 13
- 127
- 222