Check these
A non-indexed query
<?
mysql_connect('localhost');
mysql_select_db('foo');
$result=mysql_query(
        "select * from users where ts>0");
?>
And an indexed query
<?
  $result = mysql_query(
    "select * from users where id='rasmus'");
  echo "<pre>";
  system('mysqldumpslow');
  echo "</pre>\n";
?>
Output
"; system('mysqldumpslow'); echo "\n"; ?>