Joe Wilson <[EMAIL PROTECTED]> wrote:
> FYI: When this multi-row-insert patch is combined with today's CVS 
> OP_Real and OP_Int64 fix for Tickets #2733 and #2731 (Check-in [4507]), 
> the multi-row ASCII INSERT statements are as much as 25% faster than 
> the equivalent number of traditional individual ASCII INSERT statements 
> within a transaction.
> 
> i.e.,
> 
>   -- this is 25% faster...
>   INSERT INTO BIGTABLE VALUES
>    (-334712687065.09, -334712687065.12, -334712687065.13),
>    (-334712687065.09, -334712687065.12, -334712687065.13),
>    ... 9996 similar rows ...
>    (-334712687065.09, -334712687065.12, -334712687065.13),
>    (-334712687065.09, -334712687065.12, -334712687065.13);
> 
>   -- ...than this
>   BEGIN
>   INSERT INTO BIGTABLE VALUES(-334712687065.09, -334712687065.12, 
> -334712687065.13);
>   INSERT INTO BIGTABLE VALUES(-334712687065.09, -334712687065.12, 
> -334712687065.13);
>   ... 9996 similar rows ...
>   INSERT INTO BIGTABLE VALUES(-334712687065.09, -334712687065.12, 
> -334712687065.13);
>   INSERT INTO BIGTABLE VALUES(-334712687065.09, -334712687065.12, 
> -334712687065.13);
>   COMMIT;
> 

I wonder how the performance of the above compares to this:

   BEGIN;
   INSERT INTO BIGTABLE VALUES(?,?,?);  -- bind values as appropriate
   -- bind new values and rerun the same prepared statement 9999 more
   -- times.
   END;

I'm guessing that the latter is at least twice as fast as either of
the first two.

--
D. Richard Hipp <[EMAIL PROTECTED]>



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to