Same name and namespace in other branches
  1. 6.x modules/system/system.admin.inc \system_sql()

Menu callback: return information about PHP.

1 string reference to 'system_sql'
system_menu in modules/system/system.module
Implementation of hook_menu().

File

modules/system/system.module, line 1796
Configuration system that lets administrators modify the workings of the site.

Code

function system_sql() {
  $result = db_query("SHOW STATUS");
  while ($entry = db_fetch_object($result)) {
    $data[$entry->Variable_name] = $entry->Value;
  }
  $output = '<h2>' . t('Command counters') . '</h2>';
  $output .= _system_sql($data, array(
    'Com_select' => t('The number of <code>SELECT</code>-statements.'),
    'Com_insert' => t('The number of <code>INSERT</code>-statements.'),
    'Com_update' => t('The number of <code>UPDATE</code>-statements.'),
    'Com_delete' => t('The number of <code>DELETE</code>-statements.'),
    'Com_lock_tables' => t('The number of table locks.'),
    'Com_unlock_tables' => t('The number of table unlocks.'),
  ));
  $output .= '<h2>' . t('Query performance') . '</h2>';
  $output .= _system_sql($data, array(
    'Select_full_join' => t('The number of joins without an index; should be zero.'),
    'Select_range_check' => t('The number of joins without an index; should be zero.'),
    'Sort_scan' => t('The number of sorts done without using an index; should be zero.'),
    'Table_locks_immediate' => t('The number of times a lock could be acquired immediately.'),
    'Table_locks_waited' => t('The number of times the server had to wait for a lock.'),
  ));
  $output .= '<h2>' . t('Query cache information') . '</h2>';
  $output .= '<p>' . t('The MySQL query cache can improve performance of your site by storing the result of queries.  Then, if an identical query is received later, the MySQL server retrieves the result from the query cache rather than parsing and executing the statement again.') . '</p>';
  $output .= _system_sql($data, array(
    'Qcache_queries_in_cache' => t('The number of queries in the query cache.'),
    'Qcache_hits' => t('The number of times that MySQL found previous results in the cache.'),
    'Qcache_inserts' => t('The number of times that MySQL added a query to the cache (misses).'),
    'Qcache_lowmem_prunes' => t('The number of times that MySQL had to remove queries from the cache because it ran out of memory.  Ideally should be zero.'),
  ));
  return $output;
}