BENCHMARK()
BENCHMARK() is a SQL function in the MySQL Specific category. MySQL: repeatedly evaluates an expression to measure performance. Returns 0 but timing shows in query output. The syntax is BENCHMARK(count, expression). It accepts count, expression. It returns 0 (timing shown in output). A typical example: SELECT BENCHMARK(1000000, MD5('test')); -- 1 million MD5 calculations -- Result: 0 (but see execution time in the output) -- Execution time: 0.453 sec -- Compare function performance: SELECT BENCHMARK(100000, LOWER('HELLO')); SELECT BENCHMARK(100000, LCASE('HELLO')); -- Repeat to compare LOWER vs LCASE performance A close relative is AUTO_INCREMENT, which mySQL auto-generates sequential integer values for this column. Commonly used with PRIMARY KEY. A close relative is ENGINE, which specifies the MySQL storage engine. InnoDB (default) supports transactions and foreign keys. MyISAM is faster for read-heavy. A close relative is LAST_INSERT_ID(), which returns the AUTO_INCREMENT value generated by the most recent INSERT in the current connection.