note 49312 added to ref.uodbc
| From: | denials at gmail dot com | Date: | Sun, 23 Jan 2005 23:05:30 +0000 |
| Subject: | note 49312 added to ref.uodbc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83840@lists.php.net to get a copy of this message | ||
Ever wonder why you're experiencing really slow data retrieval times using IBM DB2 Universal
Database for Linux, UNIX, and Windows? The default cursor type used by Unified ODBC is not supported
by DB2, so it gets downgraded to a forward-only cursor -- and that negotiation occurs with every row
fetch.
One way to force your PHP applications to use forward-only cursors is to modify your DB2 client
configuration with a handy CLI patch2 setting value of 6:
$ db2 UPDATE CLI CONFIGURATION FOR SECTION dbname USING patch2 6
You have to update this client setting on the same machine on which you are running the PHP
application. This works on Windows operating systems as well as on Linux & UNIX operating
systems.
I ran a few basic benchmarks (fetch 10,000 rows consisting of 3 INTEGER columns from a remote
database server) and concluded that this setting can make a major difference to your application
speed:
Without CLI patch2 setting: ~22 seconds
With CLI patch2 setting: ~ 1.75 seconds
Note that the drawback of using this patch setting (or any other method of using forward-only
cursors) makes odbc_num_rows() always return "-1" for the number of rows affected by a
SELECT statement.
----
Manual Page -- http://www.php.net/manual/en/ref.uodbc.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49312
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49312&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49312&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49312&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49312&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49312&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49312&report=yes
Search -- http://master.php.net/manage/user-notes.php