I have:
- A linux server with PHP 5.3.2 and Apache 2.0
- A windows Server with SQL SERVER
I connect my linux server with database with unixODBC 2.3.1 and FREETDS 0.9.1
The connection is okay but the queries are slow. Here is my code that generate the image below:
$this->adodb->LogSQL(true); // turn on logging
$query = "select c.name, t.name, c.length from syscolumns c join systypes t on t.xusertype = c.xusertype
join sysobjects o on o.id=c.id where o.name = 'CONDOMINIO'";
$res = $this->adodb->Execute($query);
$this->adodb->LogSQL(false); // turn off logging
$perf = NewPerfMonitor($this->adodb);
echo $perf->SuspiciousSQL();
echo $perf->ExpensiveSQL();
Image http://www.vigoonline.net/slow.png
As you can see, the first query has an average time of 4.68 seconds, which is way too slow.
If I execute the same query like this:
$this->adodb->_query($query);
Then the time to execute the query takes less than a second what is great. Has anyone else experienced the same thing?
The query called with "Execute" is used for the own class for bringing the "MetaColumns" information from the table
The table "CONDOMINIO" only has 21 rows.
If the server database is in the same machine with the application script, then the response is fast!