On Wed, 2005-05-04 at 13:49 -0700, Darren Duncan wrote: > At 1:27 PM -0700 5/4/05, scott wrote: > >I can rewrite this to do individual inserts, but would like to find > >out whether there's a better workaround/idiom for this. > > If you are going to use an INSERT statement, then your usage is a > prime candidate to use prepared statements with. Your insert > statement is parsed once and then the actual data insert is > relatively little work and performs quickly. I believe this sort of > activity is what happens to implement the you wanted anyway. -- > Darren Duncan >
Be sure to enclose your INSERTs inside a BEGIN...COMMIT. Most of the time is spent doing COMMIT. INSERT is very fast - many tens of thousands per second on a typical workstation. But COMMIT is limited by disk rotation speed to about 60/sec. (It is not possible to COMMIT faster than this and still be ACID.) If you fail to enclose your INSERTs in a single BEGIN...COMMIT then separate BEGIN...COMMITs are automatically added around each INSERT, which really slows things down. -- D. Richard Hipp <[EMAIL PROTECTED]>