Name

BENCHMARK()

Synopsis

BENCHMARK(number, expression)

Use this function to evaluate the performance of a MySQL server. The expression given as the second argument of the function is repeated the number of times given in the first argument. The results are always 0. It’s the processing time reported that is meaningful. This function is meant to be used from within the mysql client. Here is an example:

SELECT BENCHMARK(1000000,PI( ));

+--------------------------+
| BENCHMARK(1000000,PI( )) |
+--------------------------+
|                        0 |
+--------------------------+
1 row in set (0.04 sec)

Get MySQL in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.