Information Functions Name Description ROW_COUNT() The number of rows updated SCHEMA() Synonym for DATABASE() SESSION_USER() Synonym for USER() SYSTEM_USER() Synonym for USER() USER() The user name and host name provided by the client VERSION() Return a string that indicates the MySQL server version • BENCHMARK( count , expr ) The  BENCHMARK()  function executes the expression  expr  repeatedly  count  times. It may be used to time how quickly MySQL processes the expression. The result value is  0 , or  NULL  for inappropriate arguments such as a  NULL  or negative repeat count. The intended use is from within the  mysql  client, which reports query execution times: mysql>  SELECT BENCHMARK(1000000,AES_ENCRYPT(’hello’,’goodbye’)); +---------------------------------------------------+ | BENCHMARK(1000000,AES_ENCRYPT(’hello’,’goodbye’)) | +---------------------------------------------------+ | 0 | +---------------------------------------------------+ 1 row in set (4.74 sec) The time reported is elapsed time on the client end, not CPU time on the server end. It is advisable to execute  BENCHMARK()  several times, and to interpret the result with regard to how heavily loaded the server machine is. BENCHMARK()  is intended for measuring the runtime performance of scalar expressions, which has some significant implications for the way that you use it and interpret the results: •Only scalar expressions can be used. Although the expression can be a subquery, it must return a single column and at most a single row. For example,  BENCHMARK(10, (SELECT * FROM t))  fails if the table  t  has more than one column or more than one row. •Executing a  SELECT  expr  statement  N  times differs from executing  SELECT BENCHMARK( N , expr )  in terms of the amount of overhead involved. The two have very different execution profiles and you should not expect them to take the same amount of time. The former involves the parser, optimizer, table locking, and runtime evaluation  N  times each. The latter involves only runtime evaluation  N  times, and all the other components just once. Memory structures already allocated are reused, and runtime optimizations such as local caching of results already evaluated for aggregate functions can alter the results. Use of  BENCHMARK()  thus measures performance of the runtime component by giving more weight to that component and removing the “noise”  introduced by the network, parser, optimizer, and so forth. • CHARSET( str ) Returns the character set of the string argument. mysql>  SELECT CHARSET(’abc’); -> ’utf8’ mysql>  SELECT CHARSET(CONVERT(’abc’ USING latin1)); -> ’latin1’ mysql>  SELECT CHARSET(USER()); 2280