I have a problem with my app in CakePHP 2.7.1, with Sqlserver Datasource.
When I do a find
operation on any table, the response time is extremely slow (more than 1 minute).
I did the research with XDebug + QCachegrind and I found out that the problem is Sqlserver->listSources()
, which lists all the 1385 tables on the database.
This is the shortened code (core file lib\Cake\Model\Datasource\Database\Sqlserver.php:172)
public function listSources($data = null) {
$result = $this->_execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES");
while ($line = $result->fetch(PDO::FETCH_NUM)) {
$tables[] = $line[0];
}
return $tables;
}
I put a simple microtime
benchmark around the while
block and nearly all the process time is taken by these 3 lines.
Is there any way to speed up this?
Is there any way to tell CakePHP not to do the listSources
process?