I finally got PHP to connect and read data from our IBM AS/400 DB2 database. I am using IBM's Client Access ODBC driver on Win2k / IIS.

But man, is it slow.

At the very max, it will return 10 results in roughly 2 seconds. Sometimes it can take as long as 15 seconds. Coming from using only MySQL up until now, this is a huge shocker.

It seems like most of the time is used during the odbc_connect stage.

Is it possible circumvent ODBC? Would it make things any faster? Would a different ODBC driver be faster than the client access one?

Also, according to the php.net site, if you run PHP as CGI [which I am] the odbc_pconnect function doesn't work. If I could somehow convert PHP to ISAPI would the odbc_pconnect function increase speed?

Any help would be great!

[on a side note, its rather disturbing to me that my 3,000 dollar PowerMac can access MySQL data thousands of times faster than a quarter of a million dollar main frame accessing its own native database :sly: ]

    One of those questions that nobody wants to answer or think about 🙂

      a year later

      Sorry, but all my experience with db2 has been that it's slow, and painfully slow. but it doesn't get slower as you add users, so it scales well. But it never runs fast.

      Since there's no db2 specific connector in PHP, it may help to update to whatever the latest ODBC driver.

        Write a Reply...