best way to do a large (30k records) insert with php+pgsql

From: Date: Tue, 19 Sep 2000 01:32:09 +0000
Subject: best way to do a large (30k records) insert with php+pgsql
Groups: php.db 
Request: Send a blank email to php-db+get-2958@lists.php.net to get a copy of this message
right now the page uses individual inserts. as can be expected, it is rather slow :) as i see it, there are two possible improvements. (a) enclose the entire thing in a transaction block, rather than after each insert (b) use a COPY statement. i'd prefer (b), but i'd like to do it without using a temporary file. is there a way to use 'COPY ... FROM stdin' with the standard set of pg_* functions in php? any input that doesn't mention mysql would be much appreciated :) thanks in advance, j. -- .----------+---------------------------------. |John Slee `-------. <indigoid@chirp.com.au>| |Chirp Web Design | http://www.chirp.com.au| |Phone 02 62301871 `--------. 02 62301515 Fax| `---------------------------+----------------'

« previous php.db (#2958) next »