--- [EMAIL PROTECTED] wrote:

> 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.

It's a tiny bit faster to use a prepared statement, but not by much.
But you're missing the point. The real point of the exercise is to:

1. Add a common and useful SQL INSERT extension that works in the 
   sqlite3 shell.

2. Speed up the SQL INSERT command from ASCII without writing 
   custom code for default columns, etc.

3. And optionally, create a .dump format that is much more compact
   on huge datasets.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to