ZF2-475: Add support of multi-insertion in 1 query

Issue Type: New Feature Created: 2012-08-18T13:37:21.000+0000 Last Updated: 2012-08-21T18:05:51.000+0000 Status: Resolved Fix version(s): Reporter: coolmic (coolmic) Assignee: Ralph Schindler (ralph) Tags: - Zend\Db

  • Insert
  • Sql
  • Zend_Db

Related issues: Attachments:


sorry for my ESL

I sometimes have to insert multiple rows (like import batch). Insert one by one may be very slow when I have 10000+ rows to insert.

I don't know about others dbms, but MySQL support multi-insertions, and it's way faster to insert 100 values in one query.

{quote} INSERT INTO tbl_name (a,b,c) VALUES (1,2,3), (4,5,6), (7,8,9); {quote}

It's should be nice to enhance Zend\Db\Sql\Insert, or create a new class to handle multi-insertion.


Posted by Ralph Schindler (ralph) on 2012-08-21T18:05:51.000+0000

I don't think this will be supported directly inside Zend\Db as multi-inserts are mostly (AFAIK) a MySQLism. I think it makes a ton of sense to have a Module or library separate from ZF that has additional enhancements specificially for Mysql (or whatever database) though, I'd like to see that live in ZFCommons.

So, for now, closing as won't fix.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.