PHP 4.0 Bug #6746: Support for Sybase bcp and large result sets
| From: | joschug at aol dot com | Date: | Thu, 14 Sep 2000 02:31:13 +0000 |
| Subject: | PHP 4.0 Bug #6746: Support for Sybase bcp and large result sets | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33247@lists.php.net to get a copy of this message | ||
From: joschug@aol.com
Operating system: Redhat 6.2
PHP version: 4.0.2
PHP Bug Type: Feature/Change Request
Bug description: Support for Sybase bcp and large result sets
I recently tried to do a select * from a large table (about 2 million rows, whole DB is about 500
Megs).
I noticed that PHP quickly ran out of memory after I did a sybase_query() and before accessing the
result set. After a quick browse through the source of php_sybase_ct.c I saw that PHP first reads
all results into an internal buffer, and after that returns each row from that buffer via
sybase_fetch_array() and the like.
I'd really like to see an incremental approach here; if I run the same query against an Oracle
DB (using the OCI-interface) I don't have these problems. I would like to dump and (re-)insert
a whole table with PHP, but with Sybase this is currently not achievable. I tried it with
server-side cursors, and it worked - but the performance dropped by factor 20 :(
I'd also like to see an interface for doing bulk inserts with bcp, maybe with an interface like
sybperl for Perl implements it. This would also be very useful for large inserts (about factor 30 on
my test system).