I’m attempting to troubleshoot why a PHP script is running slower on MariaDB 10.5.22 (~10 mins) than on MySQL 5.6 (~1 min). It’s a simple script that takes data from a CSV file and uploads to a table. For some reason, I’m seeing the following repeatedly in the MySQL general log:
4332471 Connect [email protected] on mydatabase using TCP/IP
4332471 Query SET NAMES UTF8
4332471 Quit
4332472 Connect [email protected] on mydatabase using TCP/IP
4332472 Query SET NAMES UTF8
4332472 Quit
4332473 Connect [email protected] on mydatabase using TCP/IP
4332473 Query SET NAMES UTF8
4332473 Quit
In the slow query log, I see:
SET timestamp=1720100123;
# administrator command: Quit;
# Time: 240704 14:35:24
# User@Host: myuser[myuser] @ [10.20.30.40]
# Thread_id: 1801710 Schema: mydatabase QC_hit: No
# Query_time: 0.000044 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0 Bytes_sent: 11
use mydatabase;
SET timestamp=1720100124;
SET NAMES UTF8;
# User@Host: myuser[myuser] @ [10.20.30.40]
# Thread_id: 1801710 Schema: mydatabase QC_hit: No
# Query_time: 0.000001 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0 Bytes_sent: 0
SET timestamp=1720100124;
# administrator command: Quit;
# User@Host: myuser[myuser] @ [10.20.30.40]
# Thread_id: 1801711 Schema: mydatabase QC_hit: No
# Query_time: 0.000021 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0
# Rows_affected: 0 Bytes_sent: 11
SET timestamp=1720100124;
SET NAMES UTF8;
The database collation is:
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | utf8_general_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+----------------------+-------------------+
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8 | utf8_bin |
+--------------------------+----------------------+
Any ideas why SET NAMES UTF8
is appearing repeatedly?