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 expensive 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>

Expensive SQL

Tuning the following SQL could reduce the server load substantially:

LoadCountSQLMaxMin

(missing demo data here?)

v5/performance/expensivesql.1710885047.txt.gz · Last modified: 2024/03/19 22:50 by peterdd