Okay, one relevant issue is that PHP sets default cursor type to Dynamic. While this is a nice, potentially bidirectional and sensitive-to-change cursor it can be very expensive, some ODBC drivers don't support it (OpenLink's do) and Dynamic cursors typically dont work with tables lacking a primary key (e.g. views).
To verify that this performance is directly the result of the default cursor setting, change SQL_CURSOR_DYNAMIC to SQL_CURSOR_STATIC in php_odbc.c and recompile. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -----Original Message----- > From: Mark Newnham [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 01, 2001 5:33 PM > To: '[EMAIL PROTECTED]' > Subject: [PHP-DB] DB2 Performance issue > > > This was posted on the newsgroup a couple of months ago: > > > Christian Szardenings wrote: > > > > Hi Andrew, > > > > thanks a lot for your help. Today we discovered what > > our real problem was: > > > > After "playing" a little bit with the php-scripts that try > > to connect to the IBM DB2, we set the optional parameter > > Cursortype when calling odbc_pconnect(....). > > > > And the exciting thing: When we set the cursor type > > to SQL_CUR_USE_ODBC Cursor Type, then > > the whole query speed up from 1 till 10 seconds > > to 0.2 till 0.3 seconds for 100 records. Amazing!!! > > > > Therfore, PHP is just almost fast as calling the DB2 > > from Servlets using JDBC (don't take too much care > > about the speed at whole: the database was on a > > completely other location, so the whole connection > > was made over a slow network connection). > > > > I hope this helps when other encounter the same > > problem when trying to connect to DB2 from > > PHP. > > > > Kind regards, > > Christian Szardenings > > This posting has caused some discussion amongst some of us who > are trying to > use DB2 in Native mode (i.e. using Unified ODBC) as the IBM driver manager > appears not to support this parameter. ( An odbc connect with the > specified > parameter returns [IBM][CLI Driver] CLI0150E Driver not capable. > SQLSTATE=S1C00 > > Could the author or anyone else who knows, please clarify this posting if > they are using unified odbc or perhaps a third party ODBC driver. > > > TIA > > Mark > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]