ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:performance:expensivesql

This is an old revision of the document!


expensiveSql

Syntax
mixed expensiveSql()

Description

The function expensiveSql() returns a list of SQL statements with very high execution times collected by the performance monitor logSql feature.

Usage

/*
* Connection to DB2 database
*/
 
$perf = newPerfMonitor($db);
 
/*
 * Enable logging
*/
$db->logSql();
 
/*
 * Execute invalid SQL statement
*/
$SQL = "SELECT * FROM act where actno > 200";
 
$db->execute($SQL);
 
 
$h = $perf->expensiveSql()
 
print $h;

<html> <h3>Expensive SQL</h3> <font size=1>Tuning the following SQL could reduce the server load substantially</font><br> <table border=1 bgcolor=white><tr><td><b>Load</b><td><b>Count</b><td><b>SQL</b><td><b>Max</b><td><b>Min</b></tr> </table> </html>

v5/performance/expensivesql.1440341091.txt.gz · Last modified: 2017/04/21 11:30 (external edit)