Hi,
The issue is not so much the execution of a single SQL query that returns thousands of records, but rather the execution of hundreds of SQL operations in the shortest possible time.
With an ODBC-type driver, a great deal of time is lost because of the SQLbind/SQLDesc that are performed in order to prepare the memory spaces for sending the parameters and receiving the results. This processing is not optimised in the driver (no dictionary cache, for example). So for each request sent to the server, a few ms are lost ... if you don't multiply 100 requests, you quickly lose 100 or 200 ms ...
With a native driver this overhead doesn't exist, hence my question why IBM (HCL) doesn't offer a native driver ...
Regards
------------------------------
Garcia Benjamin
------------------------------
Original Message:
Sent: Tue November 28, 2023 10:29 AM
From: Thomas Beebe
Subject: Native Informix Driver for PHP
I am not sure if this is helpful but I just put together a speed test here which had pretty consistent results. It was fetching 25mil rows from a table of fake contacts into a php array.
This was fetching it into FETCH_NUM vs FETCH_OBJ vs FETCH_BOUND
All were select first 25000000 * from names;
Except for array by name which was spelling out the field names rather than just using *.
The times do count the connect and disconnect from the database. I included the memory used just out of curiosity.
Results:
Array: 35s - Memory: 18877336832
OBJ: 41s - Memory: 28145764120
Array by name: 29s - Memory: 19145764120
By Bound Column: 26s - Memory: 268834832
Interestingly doing "unload to /dev/null select * from names" in dbaccess took 45 seconds. I did not do an equivalent esqlc program to do a full apples to apples.
------------------------------
Thomas Beebe
Vice President
xDB Systems, Inc
Woodbridge VA
5713399029
------------------------------
Original Message:
Sent: Mon November 27, 2023 01:54 PM
From: Garcia Benjamin
Subject: Native Informix Driver for PHP
Hi. We use a modified version of pdo_informix.
Server side informix is quicker than psql. Client side the interface between php and the driver we can clearly see that psql is must quicker. The overhead of binding and field description of the odbc driver is a bottelneck....
Regards
Original Message:
Sent: 11/27/2023 1:11:00 PM
From: Thomas Beebe
Subject: RE: Native Informix Driver for PHP
Just checking, are you using PDO_ODBC or PDO_INFORMIX?
Also, how are you fetching the data, are you doing bindcolumn or just a standard fetch into an object/array?
I haven't benchmarked against PgSQL, but when I did earlier benchmarks fetching vs direct fetches using dbaccess it was very close in performance.
As you said, the connection overhead is real if you are doing a connect on each request, but it sounds like you have a solution for that.
------------------------------
Thomas Beebe
Vice President
xDB Systems, Inc
Woodbridge VA
5713399029