in reply to Database input speed question

In addition to what've been said, the following statement could also be considered if sensible to the program (multiple rows in one insert statement).

INSERT INTO table VALUES (val11,val2), (val21,val22), (val31,val32)

But the DB native batch facility is still the best bet especially if the insert doesn't have to be real time.

Replies are listed 'Best First'.
Re: Re: Database input speed question
by Mur (Pilgrim) on Jul 31, 2003 at 17:45 UTC
    I must point out that syntax doesn't work in all DBMS. For PostgreSQL, you'll need something a bit more complex:
    INSERT INTO table SELECT val11, val12 UNION SELECT val21, val22 UNION SELECT val31, val32 etc.
    I don't think this will be significantly faster for large collections of data than to just use DBI with a statement handle and placeholders (but YMMV).
    --
    Jeff Boes
    Database Engineer
    Nexcerpt, Inc.
    vox 269.226.9550 ext 24
    fax 269.349.9076
     http://www.nexcerpt.com
    ...Nexcerpt...Connecting People With Expertise
      Thanks for the clarification.