TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   MySQL & Databases (http://www.talkphp.com/mysql-databases/)
-   -   Value set limitations on MySQL INSERT? (http://www.talkphp.com/mysql-databases/5042-value-set-limitations-mysql-insert.html)

delayedinsanity 10-21-2009 05:13 AM

Value set limitations on MySQL INSERT?
 
Trying to find any information on this via google is ridiculous, considering the term "LIMIT" can be part of almost any MySQL statement...

I'm curious if there's an upper limit to the number of value sets you can include in a single INSERT, for eg;

INSERT INTO `table` (row_one, row_two) VALUES ('x', 'x'), ('x', 'x'), ('x', 'x'), ('x', 'x'), ('x', 'x') .....

I noticed that when you do an SQL dump from phpMyAdmin it iterates a new INSERT every 200 rows or so, but the number varies, give or take 15 rows. So I'm assuming this is just to keep your import from timing out more than following any rigid rules.

Anybody here know?

adamdecaf 10-21-2009 11:13 PM

These could all be causes: timeout regulations, max server load, general style, page breaks..

delayedinsanity 10-22-2009 03:51 AM

Yeah, I'm willing to presume that timeouts are the biggest enemy of large insert statements. S'all good, without knowing for sure I just went ahead and wrote a little function to split it up for me. Maybe one day I'll throw a thousand at it and see if it can take it. :)

Etheco 10-22-2009 05:33 PM

There of course is a limit but when i tried researching this i found nothing.

I did a import a few days ago to do a mass update on 7.7mil products. i did a 1000 at a time i think possibly higher.

I must admit they did not contain alot of information 2 rows doing one row the the other. but it seemed to run fine. You can possibly chuck alot at it but you just have to be realistic in the end. With my imports i do chunks of 100 too for performance it works perfectly.

If you really want to test it, you will just have to keep putting tests through and see when it chokes.


All times are GMT. The time now is 03:20 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0