Re: question about ODBC and PHP
| From: | Richard Lynch | Date: | Sat, 20 Jul 2002 06:09:12 +0000 |
| Subject: | Re: question about ODBC and PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108628@lists.php.net to get a copy of this message | ||
>I am new to PHP, and I have got to download huge quantity of data from an
>oracle server.
>The ODBC cnnection works fine, and I found a useful "odbc_fetch_array()"
>function on this site.
>
>Until now I store the data row after row into a temporrary file, and with it
>i fill MySQL tables.
>
>The construction of the file takes nearly 50 minutes each , I have 10-12
>tables to search in,
>and joins to make to integrate data in a final table.... ( !!! )
>
>
>Is there a quicker method to get data in an odbc result resource??
With Oracle, I think you can odbc_something_something the whole thing in one
giant array...
That said, I'm willing to bet a DOLLAR that your FILE access is what's
killing the performance, not the ODBC/Oracle or MySQL actions.
If you can get PHP to talk to *BOTH* databases at once, and skip the
intermediate TEMP FILE, you'll probably see a huge performance increase.
Another option is to skip PHP entirely... I mean Oracle *HAS* to have some
kind of export utility to create a tab delimited file, doesn't it? For what
you paid for it, it had better have that!
That's bound to be faster than a PHP loop to write out data...
You may also want to consider using INSERT DELAYED on the MySQL side. It
*MIGHT* let the PHP script finish sooner, and then MySQL will insert the
data whenever it gets around to it... I've never played with it, just read
the docs.
--
Like Music? http://l-i-e.com/artists.htm