ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:performance:suspicioussql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:performance:suspicioussql [2016/01/13 02:14] – ↷ Page moved from performance:suspicioussql to v5:performance:suspicioussql mnewnhamv5:performance:suspicioussql [2024/03/21 16:14] (current) – Screenshot with sample output dregad
Line 2: Line 2:
 ~~NOTOC~~ ~~NOTOC~~
 <WRAP right box> <WRAP right box>
 +
 == Syntax == == Syntax ==
-  mixed suspicioudSql()+  string suspiciousSql()
 </WRAP> </WRAP>
 +
 ===== Description ===== ===== Description =====
-The function ''suspiciousSql()'' returns a list of SQL statements with high average execution times collected by the performance monitor logSql feature.+ 
 +The function ''suspiciousSql()'' returns a list of SQL statements with high average execution times collected by the performance monitor logSql feature, formatted as an HTML table. 
 ===== Usage ===== ===== Usage =====
 <code php> <code php>
Line 21: Line 25:
  
 /* /*
- * Execute invalid SQL statement+ * Execute suspicious SQL statement
 */ */
 $SQL = "SELECT * FROM act where actno > 200"; $SQL = "SELECT * FROM act where actno > 200";
Line 28: Line 32:
  
  
-$h = $perf->suspiciousSql()+$h = $perf->suspiciousSql();
  
 print $h; print $h;
- 
 </code> </code>
  
-<html> +==== Output ====
-<h3>Suspicious SQL</h3> +
-<font size=1>The following SQL have high average execution times</font><br> +
-<table border=1 bgcolor=white><tr><td><b>Avg Time</b><td><b>Count</b><td><b>SQL</b><td><b>Max</b><td><b>Min</b></tr> +
-<tr><td>0.065087<td align=right>1<td><font size=-1><a target=sql205519396 href="?hidem=1&exps=1&sql=SELECT+%2A+FROM+act+where+actno+%3E+%27A%27&x#explain">SELECT * FROM act where actno &gt; 200</a></font><td>0.065087<td>0.065087</tr><tr><td>0.062797<td align=right>1<td><font size=-1><a target=sql1678387404 href="?hidem=1&exps=1&sql=insert+into+adodb_logsql+%28created%2Csql0%2Csql1%2Cparams%2Ctracer%2Ctimer%29+values%28+CURRENT+TIMESTAMP%2C%3F%2C%3F%2C%3F%2C%3F%2C%3F%29&x#explain">insert into adodb_logsql (created,sql0,sql1,params,tracer,timer) values( CURRENT TIMESTAMP,?,?,?,?,?)</a></font><td>0.062797<td>0.062797</tr></table> +
-</html> +
  
 +{{:v5:performance:performance-suspicious-sql.png}}
v5/performance/suspicioussql.1452647655.txt.gz · Last modified: 2017/04/21 11:30 (external edit)