Fungsi BENCHMARK() mengeksekusi ekspresi expr berulang kali, menghitung waktu. Ini mungkin digunakan untuk mengukur seberapa cepat MySQL memproses ekspresi. Nilai hasilnya adalah 0, atau NULL untuk argumen yang tidak sesuai seperti NULL atau jumlah pengulangan negatif.
SELECT BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye'));
+---------------------------------------------------+
| BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye')) |
+---------------------------------------------------+
| 0 |
+---------------------------------------------------+
1 row in set (4.74 sec)
The intended use is from within the mysql client, which reports query execution times:
SELECT BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye'));
+---------------------------------------------------+
| BENCHMARK(1000000,AES_ENCRYPT('hello','goodbye')) |
+---------------------------------------------------+
| 0 |
+---------------------------------------------------+
1 row in set (4.74 sec)