I've a lot of components using the old driver mssql from PHP. I want to switch to the new driver SQLSRV by Microsoft but my queries are a lot of slower.
I've many processes handling +400 000 rows.
Here are my tests with 40 000 rows :
- testOldDriver_mssql = Rows 40000 : 1 seconds
- testNewDriver_nonPDO = Rows 40000 : 7 seconds
- testNewDriver_PDO = Rows 40000 : 4 seconds
Here my biggest proccess (+480 000 rows) :
- testOldDriver_mssql = Rows 484856 : 27 seconds
- testNewDriver_nonPDO = Rows 484856 : 120 seconds
- testNewDriver_PDO = Rows 484856 : 47 seconds
- testPDO_ODBC = Rows 484856 : 24 seconds
Is the new driver definitely slower ? Or am I'm missing something ?
Edit 1:
By "old driver" I mean the deprecated MSSQL library (see php.net/mssql).
The new driver is the one made directly by Microsoft (see http://www.microsoft.com/en-us/download/details.aspx?id=20098)
My query is
SELECT * FROM myTable
WHERE pdvSaisie IN
(SELECT number FROM pdvs WHERE nom LIKE 'ZUEE %')
and using a direct query()
(no prepare and same result if I use a prepared statement).
Edit 2:
Added PDO/ODBC test. Surprise, it's faster :o