2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Merging the Limesurvey 1.91+ branch of queXS in to the trunk

This commit is contained in:
azammitdcarf
2011-09-08 01:58:41 +00:00
parent dfa55a3b9e
commit eaa9578ab8
2312 changed files with 811461 additions and 597534 deletions

View File

@@ -1,30 +1,30 @@
<?php
/*
V5.08 6 Apr 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Set tabs to 4 for best viewing.
Latest version is available at http://adodb.sourceforge.net
Library for basic performance monitoring and tuning
*/
/*
V5.09 25 June 2009 (c) 2000-2009 John Lim (jlim#natsoft.com). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence. See License.txt.
Set tabs to 4 for best viewing.
Latest version is available at http://adodb.sourceforge.net
Library for basic performance monitoring and tuning
*/
// security - hide paths
if (!defined('ADODB_DIR')) die();
class perf_oci8 extends ADODB_perf{
var $noShowIxora = 15; // if the sql for suspicious sql is taking too long, then disable ixora
var $tablesSQL = "select segment_name as \"tablename\", sum(bytes)/1024 as \"size_in_k\",tablespace_name as \"tablespace\",count(*) \"extents\" from sys.user_extents
var $noShowIxora = 15; // if the sql for suspicious sql is taking too long, then disable ixora
var $tablesSQL = "select segment_name as \"tablename\", sum(bytes)/1024 as \"size_in_k\",tablespace_name as \"tablespace\",count(*) \"extents\" from sys.user_extents
group by segment_name,tablespace_name";
var $version;
var $createTableSQL = "CREATE TABLE adodb_logsql (
var $version;
var $createTableSQL = "CREATE TABLE adodb_logsql (
created date NOT NULL,
sql0 varchar(250) NOT NULL,
sql1 varchar(4000) NOT NULL,
@@ -32,8 +32,8 @@ class perf_oci8 extends ADODB_perf{
tracer varchar(4000),
timer decimal(16,6) NOT NULL
)";
var $settings = array(
var $settings = array(
'Ratios',
'data cache hit ratio' => array('RATIOH',
"select round((1-(phy.value / (cur.value + con.value)))*100,2)
@@ -42,18 +42,18 @@ class perf_oci8 extends ADODB_perf{
con.name = 'consistent gets' and
phy.name = 'physical reads'",
'=WarnCacheRatio'),
'sql cache hit ratio' => array( 'RATIOH',
'select round(100*(sum(pins)-sum(reloads))/sum(pins),2) from v$librarycache',
'increase <i>shared_pool_size</i> if too ratio low'),
'datadict cache hit ratio' => array('RATIOH',
"select
round((1 - (sum(getmisses) / (sum(gets) +
sum(getmisses))))*100,2)
from v\$rowcache",
'increase <i>shared_pool_size</i> if too ratio low'),
'memory sort ratio' => array('RATIOH',
"SELECT ROUND((100 * b.VALUE) /DECODE ((a.VALUE + b.VALUE),
0,1,(a.VALUE + b.VALUE)),2)
@@ -66,12 +66,12 @@ AND b.name = 'sorts (memory)'",
'IO',
'data reads' => array('IO',
"select value from v\$sysstat where name='physical reads'"),
'data writes' => array('IO',
"select value from v\$sysstat where name='physical writes'"),
'Data Cache',
'data cache buffers' => array( 'DATAC',
"select a.value/b.value from v\$parameter a, v\$parameter b
where a.name = 'db_cache_size' and b.name= 'db_block_size'",
@@ -79,7 +79,7 @@ AND b.name = 'sorts (memory)'",
'data cache blocksize' => array('DATAC',
"select value from v\$parameter where name='db_block_size'",
'' ),
'Memory Pools',
'SGA Max Size' => array( 'DATAC',
"select value from v\$parameter where name = 'sga_max_size'",
@@ -104,7 +104,7 @@ AND b.name = 'sorts (memory)'",
"select value from v\$parameter where name='pga_aggregate_target'",
'program global area is private memory for sorting, and hash and bitmap merges - since oracle 9i (pga_aggregate_target)' ),
'Connections',
'current connections' => array('SESS',
'select count(*) from sys.v_$session where username is not null',
@@ -119,14 +119,14 @@ AND b.name = 'sorts (memory)'",
from (select sum(bytes) sgasize from sys.v_\$sgastat) s, sys.v_\$sgastat f
where name = 'free memory' and pool = 'shared pool'",
'Percentage of data cache actually in use - should be over 85%'),
'shared pool utilization ratio' => array('RATIOU',
'select round((sga.bytes/case when p.value=0 then sga.bytes else to_number(p.value) end)*100,2)
from v$sgastat sga, v$parameter p
where sga.name = \'free memory\' and sga.pool = \'shared pool\'
and p.name = \'shared_pool_size\'',
'Percentage of shared pool actually used - too low is bad, too high is worse'),
'large pool utilization ratio' => array('RATIOU',
"select round((1-bytes/sgasize)*100, 2)
from (select sum(bytes) sgasize from sys.v_\$sgastat) s, sys.v_\$sgastat f
@@ -142,7 +142,7 @@ AND b.name = 'sorts (memory)'",
'rollback segments' => array('ROLLBACK',
"select count(*) from sys.v_\$rollstat",
''),
'peak transactions' => array('ROLLBACK',
"select max_utilization tx_hwm
from sys.v_\$resource_limit
@@ -155,19 +155,19 @@ AND b.name = 'sorts (memory)'",
'cursor sharing' => array('CURSOR',
"select value from v\$parameter where name = 'cursor_sharing'",
'Cursor reuse strategy. Recommended is FORCE (8i+) or SIMILAR (9i+). See <a href=http://www.praetoriate.com/oracle_tips_cursor_sharing.htm>cursor_sharing</a>.'),
/*
'cursor reuse' => array('CURSOR',
"select count(*) from (select sql_text_wo_constants, count(*)
from t1
group by sql_text_wo_constants
having count(*) > 100)",'These are sql statements that should be using bind variables'),*/
/*
'cursor reuse' => array('CURSOR',
"select count(*) from (select sql_text_wo_constants, count(*)
from t1
group by sql_text_wo_constants
having count(*) > 100)",'These are sql statements that should be using bind variables'),*/
'index cache cost' => array('COST',
"select value from v\$parameter where name = 'optimizer_index_caching'",
'=WarnIndexCost'),
'random page cost' => array('COST',
"select value from v\$parameter where name = 'optimizer_index_cost_adj'",
'=WarnPageCost'),
'Backup',
'Achivelog Mode' => array('BACKUP', 'select log_mode from v$database', 'To turn on archivelog:<br>
<pre>
@@ -179,49 +179,49 @@ having count(*) > 100)",'These are sql statements that should be using bind vari
SQLPLUS> archive log start;
SQLPLUS> alter database open;
</pre>'),
'DBID' => array('BACKUP','select dbid from v$database','Primary key of database, used for recovery with an RMAN Recovery Catalog'),
'Archive Log Dest' => array('BACKUP', "SELECT NVL(v1.value,v2.value)
FROM v\$parameter v1, v\$parameter v2 WHERE v1.name='log_archive_dest' AND v2.name='log_archive_dest_10'", ''),
'Flashback Area' => array('BACKUP', "select nvl(value,'Flashback Area not used') from v\$parameter where name=lower('DB_RECOVERY_FILE_DEST')", 'Flashback area is a folder where all backup data and logs can be stored and managed by Oracle. If Error: message displayed, then it is not in use.'),
'Control File Keep Time' => array('BACKUP', "select value from v\$parameter where name='control_file_record_keep_time'",'No of days to keep RMAN info in control file. I recommend it be set to x2 or x3 times the frequency of your full backup.'),
false
);
function perf_oci8(&$conn)
{
$savelog = $conn->LogSQL(false);
$this->version = $conn->ServerInfo();
$conn->LogSQL($savelog);
$this->conn = $conn;
}
function WarnPageCost($val)
{
if ($val == 100) $s = '<font color=red><b>Too High</b>. </font>';
else $s = '';
return $s.'Recommended is 20-50 for TP, and 50 for data warehouses. Default is 100. See <a href=http://www.dba-oracle.com/oracle_tips_cost_adj.htm>optimizer_index_cost_adj</a>. ';
}
function WarnIndexCost($val)
{
if ($val == 0) $s = '<font color=red><b>Too Low</b>. </font>';
else $s = '';
return $s.'Percentage of indexed data blocks expected in the cache.
false
);
function perf_oci8(&$conn)
{
$savelog = $conn->LogSQL(false);
$this->version = $conn->ServerInfo();
$conn->LogSQL($savelog);
$this->conn = $conn;
}
function WarnPageCost($val)
{
if ($val == 100) $s = '<font color=red><b>Too High</b>. </font>';
else $s = '';
return $s.'Recommended is 20-50 for TP, and 50 for data warehouses. Default is 100. See <a href=http://www.dba-oracle.com/oracle_tips_cost_adj.htm>optimizer_index_cost_adj</a>. ';
}
function WarnIndexCost($val)
{
if ($val == 0) $s = '<font color=red><b>Too Low</b>. </font>';
else $s = '';
return $s.'Percentage of indexed data blocks expected in the cache.
Recommended is 20 (fast disk array) to 30 (slower hard disks). Default is 0.
See <a href=http://www.dba-oracle.com/oracle_tips_cbo_part1.htm>optimizer_index_caching</a>.';
}
function PGA()
{
if ($this->version['version'] < 9) return 'Oracle 9i or later required';
$rs = $this->conn->Execute("select a.mb,a.targ as pga_size_pct,a.pct from
}
function PGA()
{
if ($this->version['version'] < 9) return 'Oracle 9i or later required';
$rs = $this->conn->Execute("select a.mb,a.targ as pga_size_pct,a.pct from
(select round(pga_target_for_estimate/1024.0/1024.0,0) Mb,
pga_target_factor targ,estd_pga_cache_hit_percentage pct,rownum as r
from v\$pga_target_advice) a left join
@@ -230,19 +230,19 @@ FROM v\$parameter v1, v\$parameter v2 WHERE v1.name='log_archive_dest' AND v2.na
from v\$pga_target_advice) b on
a.r = b.r+1 where
b.pct < 100");
if (!$rs) return "Only in 9i or later";
$rs->Close();
if ($rs->EOF) return "PGA could be too big";
return reset($rs->fields);
}
function Explain($sql,$partial=false)
{
$savelog = $this->conn->LogSQL(false);
$rs = $this->conn->SelectLimit("select ID FROM PLAN_TABLE");
if (!$rs) {
echo "<p><b>Missing PLAN_TABLE</b></p>
if (!$rs) return "Only in 9i or later";
$rs->Close();
if ($rs->EOF) return "PGA could be too big";
return reset($rs->fields);
}
function Explain($sql,$partial=false)
{
$savelog = $this->conn->LogSQL(false);
$rs = $this->conn->SelectLimit("select ID FROM PLAN_TABLE");
if (!$rs) {
echo "<p><b>Missing PLAN_TABLE</b></p>
<pre>
CREATE TABLE PLAN_TABLE (
STATEMENT_ID VARCHAR2(30),
@@ -271,57 +271,57 @@ CREATE TABLE PLAN_TABLE (
DISTRIBUTION VARCHAR2(30)
);
</pre>";
return false;
}
$rs->Close();
// $this->conn->debug=1;
if ($partial) {
$sqlq = $this->conn->qstr($sql.'%');
$arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
if ($arr) {
foreach($arr as $row) {
$sql = reset($row);
if (crc32($sql) == $partial) break;
}
}
}
$s = "<p><b>Explain</b>: ".htmlspecialchars($sql)."</p>";
$this->conn->BeginTrans();
$id = "ADODB ".microtime();
return false;
}
$rs = $this->conn->Execute("EXPLAIN PLAN SET STATEMENT_ID='$id' FOR $sql");
$m = $this->conn->ErrorMsg();
if ($m) {
$this->conn->RollbackTrans();
$this->conn->LogSQL($savelog);
$s .= "<p>$m</p>";
return $s;
}
$rs = $this->conn->Execute("
$rs->Close();
// $this->conn->debug=1;
if ($partial) {
$sqlq = $this->conn->qstr($sql.'%');
$arr = $this->conn->GetArray("select distinct sql1 from adodb_logsql where sql1 like $sqlq");
if ($arr) {
foreach($arr as $row) {
$sql = reset($row);
if (crc32($sql) == $partial) break;
}
}
}
$s = "<p><b>Explain</b>: ".htmlspecialchars($sql)."</p>";
$this->conn->BeginTrans();
$id = "ADODB ".microtime();
$rs = $this->conn->Execute("EXPLAIN PLAN SET STATEMENT_ID='$id' FOR $sql");
$m = $this->conn->ErrorMsg();
if ($m) {
$this->conn->RollbackTrans();
$this->conn->LogSQL($savelog);
$s .= "<p>$m</p>";
return $s;
}
$rs = $this->conn->Execute("
select
'<pre>'||lpad('--', (level-1)*2,'-') || trim(operation) || ' ' || trim(options)||'</pre>' as Operation,
object_name,COST,CARDINALITY,bytes
FROM plan_table
START WITH id = 0 and STATEMENT_ID='$id'
CONNECT BY prior id=parent_id and statement_id='$id'");
$s .= rs2html($rs,false,false,false,false);
$this->conn->RollbackTrans();
$this->conn->LogSQL($savelog);
$s .= $this->Tracer($sql,$partial);
return $s;
}
function CheckMemory()
{
if ($this->version['version'] < 9) return 'Oracle 9i or later required';
$rs = $this->conn->Execute("
$s .= rs2html($rs,false,false,false,false);
$this->conn->RollbackTrans();
$this->conn->LogSQL($savelog);
$s .= $this->Tracer($sql,$partial);
return $s;
}
function CheckMemory()
{
if ($this->version['version'] < 9) return 'Oracle 9i or later required';
$rs = $this->conn->Execute("
select a.size_for_estimate as cache_mb_estimate,
case when a.size_factor=1 then
'&lt;&lt;= current'
@@ -331,73 +331,73 @@ select a.size_for_estimate as cache_mb_estimate,
a.estd_physical_read_factor-b.estd_physical_read_factor as best_when_0
from (select size_for_estimate,size_factor,estd_physical_read_factor,rownum r from v\$db_cache_advice) a ,
(select size_for_estimate,size_factor,estd_physical_read_factor,rownum r from v\$db_cache_advice) b where a.r = b.r-1");
if (!$rs) return false;
/*
The v$db_cache_advice utility show the marginal changes in physical data block reads for different sizes of db_cache_size
*/
$s = "<h3>Data Cache Estimate</h3>";
if ($rs->EOF) {
$s .= "<p>Cache that is 50% of current size is still too big</p>";
} else {
$s .= "Ideal size of Data Cache is when \"best_when_0\" changes from a positive number and becomes zero.";
$s .= rs2html($rs,false,false,false,false);
}
return $s;
}
/*
Generate html for suspicious/expensive sql
*/
function tohtml(&$rs,$type)
{
$o1 = $rs->FetchField(0);
$o2 = $rs->FetchField(1);
$o3 = $rs->FetchField(2);
if ($rs->EOF) return '<p>None found</p>';
$check = '';
$sql = '';
$s = "\n\n<table border=1 bgcolor=white><tr><td><b>".$o1->name.'</b></td><td><b>'.$o2->name.'</b></td><td><b>'.$o3->name.'</b></td></tr>';
while (!$rs->EOF) {
if ($check != $rs->fields[0].'::'.$rs->fields[1]) {
if ($check) {
$carr = explode('::',$check);
$prefix = "<a href=\"?$type=1&sql=".rawurlencode($sql).'&x#explain">';
$suffix = '</a>';
if (strlen($prefix)>2000) {
$prefix = '';
$suffix = '';
}
$s .= "\n<tr><td align=right>".$carr[0].'</td><td align=right>'.$carr[1].'</td><td>'.$prefix.$sql.$suffix.'</td></tr>';
}
$sql = $rs->fields[2];
$check = $rs->fields[0].'::'.$rs->fields[1];
} else
$sql .= $rs->fields[2];
if (substr($sql,strlen($sql)-1) == "\0") $sql = substr($sql,0,strlen($sql)-1);
$rs->MoveNext();
}
$rs->Close();
$carr = explode('::',$check);
$prefix = "<a target=".rand()." href=\"?&hidem=1&$type=1&sql=".rawurlencode($sql).'&x#explain">';
$suffix = '</a>';
if (strlen($prefix)>2000) {
$prefix = '';
$suffix = '';
}
$s .= "\n<tr><td align=right>".$carr[0].'</td><td align=right>'.$carr[1].'</td><td>'.$prefix.$sql.$suffix.'</td></tr>';
return $s."</table>\n\n";
}
// code thanks to Ixora.
// http://www.ixora.com.au/scripts/query_opt.htm
// requires oracle 8.1.7 or later
function SuspiciousSQL($numsql=10)
{
$sql = "
if (!$rs) return false;
/*
The v$db_cache_advice utility show the marginal changes in physical data block reads for different sizes of db_cache_size
*/
$s = "<h3>Data Cache Estimate</h3>";
if ($rs->EOF) {
$s .= "<p>Cache that is 50% of current size is still too big</p>";
} else {
$s .= "Ideal size of Data Cache is when \"best_when_0\" changes from a positive number and becomes zero.";
$s .= rs2html($rs,false,false,false,false);
}
return $s;
}
/*
Generate html for suspicious/expensive sql
*/
function tohtml(&$rs,$type)
{
$o1 = $rs->FetchField(0);
$o2 = $rs->FetchField(1);
$o3 = $rs->FetchField(2);
if ($rs->EOF) return '<p>None found</p>';
$check = '';
$sql = '';
$s = "\n\n<table border=1 bgcolor=white><tr><td><b>".$o1->name.'</b></td><td><b>'.$o2->name.'</b></td><td><b>'.$o3->name.'</b></td></tr>';
while (!$rs->EOF) {
if ($check != $rs->fields[0].'::'.$rs->fields[1]) {
if ($check) {
$carr = explode('::',$check);
$prefix = "<a href=\"?$type=1&sql=".rawurlencode($sql).'&x#explain">';
$suffix = '</a>';
if (strlen($prefix)>2000) {
$prefix = '';
$suffix = '';
}
$s .= "\n<tr><td align=right>".$carr[0].'</td><td align=right>'.$carr[1].'</td><td>'.$prefix.$sql.$suffix.'</td></tr>';
}
$sql = $rs->fields[2];
$check = $rs->fields[0].'::'.$rs->fields[1];
} else
$sql .= $rs->fields[2];
if (substr($sql,strlen($sql)-1) == "\0") $sql = substr($sql,0,strlen($sql)-1);
$rs->MoveNext();
}
$rs->Close();
$carr = explode('::',$check);
$prefix = "<a target=".rand()." href=\"?&hidem=1&$type=1&sql=".rawurlencode($sql).'&x#explain">';
$suffix = '</a>';
if (strlen($prefix)>2000) {
$prefix = '';
$suffix = '';
}
$s .= "\n<tr><td align=right>".$carr[0].'</td><td align=right>'.$carr[1].'</td><td>'.$prefix.$sql.$suffix.'</td></tr>';
return $s."</table>\n\n";
}
// code thanks to Ixora.
// http://www.ixora.com.au/scripts/query_opt.htm
// requires oracle 8.1.7 or later
function SuspiciousSQL($numsql=10)
{
$sql = "
select
substr(to_char(s.pct, '99.00'), 2) || '%' load,
s.executions executes,
@@ -432,46 +432,46 @@ where
order by
1 desc, s.address, p.piece";
global $ADODB_CACHE_MODE;
if (isset($_GET['expsixora']) && isset($_GET['sql'])) {
$partial = empty($_GET['part']);
echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
}
global $ADODB_CACHE_MODE;
if (isset($_GET['expsixora']) && isset($_GET['sql'])) {
$partial = empty($_GET['part']);
echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
}
if (isset($_GET['sql'])) return $this->_SuspiciousSQL($numsql);
$s = '';
$timer = time();
$s .= $this->_SuspiciousSQL($numsql);
$timer = time() - $timer;
if ($timer > $this->noShowIxora) return $s;
$s .= '<p>';
$save = $ADODB_CACHE_MODE;
$ADODB_CACHE_MODE = ADODB_FETCH_NUM;
if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
$savelog = $this->conn->LogSQL(false);
$rs = $this->conn->SelectLimit($sql);
$this->conn->LogSQL($savelog);
if (isset($savem)) $this->conn->SetFetchMode($savem);
$ADODB_CACHE_MODE = $save;
if ($rs) {
$s .= "\n<h3>Ixora Suspicious SQL</h3>";
$s .= $this->tohtml($rs,'expsixora');
}
return $s;
}
// code thanks to Ixora.
// http://www.ixora.com.au/scripts/query_opt.htm
// requires oracle 8.1.7 or later
function ExpensiveSQL($numsql = 10)
{
$sql = "
if (isset($_GET['sql'])) return $this->_SuspiciousSQL($numsql);
$s = '';
$timer = time();
$s .= $this->_SuspiciousSQL($numsql);
$timer = time() - $timer;
if ($timer > $this->noShowIxora) return $s;
$s .= '<p>';
$save = $ADODB_CACHE_MODE;
$ADODB_CACHE_MODE = ADODB_FETCH_NUM;
if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
$savelog = $this->conn->LogSQL(false);
$rs = $this->conn->SelectLimit($sql);
$this->conn->LogSQL($savelog);
if (isset($savem)) $this->conn->SetFetchMode($savem);
$ADODB_CACHE_MODE = $save;
if ($rs) {
$s .= "\n<h3>Ixora Suspicious SQL</h3>";
$s .= $this->tohtml($rs,'expsixora');
}
return $s;
}
// code thanks to Ixora.
// http://www.ixora.com.au/scripts/query_opt.htm
// requires oracle 8.1.7 or later
function ExpensiveSQL($numsql = 10)
{
$sql = "
select
substr(to_char(s.pct, '99.00'), 2) || '%' load,
s.executions executes,
@@ -506,48 +506,48 @@ where
order by
1 desc, s.address, p.piece
";
global $ADODB_CACHE_MODE;
if (isset($_GET['expeixora']) && isset($_GET['sql'])) {
$partial = empty($_GET['part']);
echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
}
if (isset($_GET['sql'])) {
$var = $this->_ExpensiveSQL($numsql);
return $var;
}
$s = '';
$timer = time();
$s .= $this->_ExpensiveSQL($numsql);
$timer = time() - $timer;
if ($timer > $this->noShowIxora) return $s;
$s .= '<p>';
$save = $ADODB_CACHE_MODE;
$ADODB_CACHE_MODE = ADODB_FETCH_NUM;
if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
$savelog = $this->conn->LogSQL(false);
$rs = $this->conn->Execute($sql);
$this->conn->LogSQL($savelog);
if (isset($savem)) $this->conn->SetFetchMode($savem);
$ADODB_CACHE_MODE = $save;
if ($rs) {
$s .= "\n<h3>Ixora Expensive SQL</h3>";
$s .= $this->tohtml($rs,'expeixora');
}
return $s;
}
function clearsql()
{
$perf_table = adodb_perf::table();
// using the naive "delete from $perf_table where created<".$this->conn->sysTimeStamp will cause the table to lock, possibly
// for a long time
$sql =
global $ADODB_CACHE_MODE;
if (isset($_GET['expeixora']) && isset($_GET['sql'])) {
$partial = empty($_GET['part']);
echo "<a name=explain></a>".$this->Explain($_GET['sql'],$partial)."\n";
}
if (isset($_GET['sql'])) {
$var = $this->_ExpensiveSQL($numsql);
return $var;
}
$s = '';
$timer = time();
$s .= $this->_ExpensiveSQL($numsql);
$timer = time() - $timer;
if ($timer > $this->noShowIxora) return $s;
$s .= '<p>';
$save = $ADODB_CACHE_MODE;
$ADODB_CACHE_MODE = ADODB_FETCH_NUM;
if ($this->conn->fetchMode !== false) $savem = $this->conn->SetFetchMode(false);
$savelog = $this->conn->LogSQL(false);
$rs = $this->conn->Execute($sql);
$this->conn->LogSQL($savelog);
if (isset($savem)) $this->conn->SetFetchMode($savem);
$ADODB_CACHE_MODE = $save;
if ($rs) {
$s .= "\n<h3>Ixora Expensive SQL</h3>";
$s .= $this->tohtml($rs,'expeixora');
}
return $s;
}
function clearsql()
{
$perf_table = adodb_perf::table();
// using the naive "delete from $perf_table where created<".$this->conn->sysTimeStamp will cause the table to lock, possibly
// for a long time
$sql =
"DECLARE cnt pls_integer;
BEGIN
cnt := 0;
@@ -563,8 +563,8 @@ BEGIN
commit;
END;";
$ok = $this->conn->Execute($sql);
}
$ok = $this->conn->Execute($sql);
}
}
?>