[CDBI] Make CDBI go fast

Oliver Jeeves oj at defuturo.co.uk
Thu Feb 15 09:26:33 GMT 2007


Perrin Harkins wrote:
>> * A bulk insert method
>> * A bulk delete method
>>
>> Calling ->insert over and over again is inefficient.  Having to load
>> an object only to delete it is even worse.  Bulk insert and delete
>> methods would be handy.
>>
>> For insert the syntax it could be as simple as...
>>
>>     Class->bulk_insert({ foo => 42 }, { foo => 23 }, { foo => 99 });
> 
> Bulk delete is covered by the other tools mentioned above, but they
> don't support any kind of bulk insert that I'm aware of.  To make bulk
> inserts really fast, you have to use database specific extensions,
> like MySQL's multi-row insert statement.

DBIx::Class has a populate method, which inserts multiple rows.

It doesn't appear to take advantage of any DB specific features to do
so; it just does multiple inserts. If the documentation is anything to
go by.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.digitalcraftsmen.net/pipermail/classdbi/attachments/20070215/d68f17e5/signature.pgp


More information about the ClassDBI mailing list