BENCHMARK

2025-11-14 07:33:32  Updated

Syntax

BENCHMARK(count,expr)

Purpose

BENCHMARK() executes the expr expression the number of times specified by count and return 0. It returns NULL if the arguments are invalid, for example, if the expression is NULL or a negative value is specified for count.

expr must be a scalar expression. BENCHMARK() can be used to measure the running performance of a scalar expression. The time in the performance report is the running time on the client rather than the CPU time on the server.

Examples

obclient> SELECT BENCHMARK(100,AES_ENCRYPT('hello','world'));
+---------------------------------------------+
| BENCHMARK(100,AES_ENCRYPT('hello','world')) |
+---------------------------------------------+
|                                           0 |
+---------------------------------------------+

Contact Us