TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-21-2009, 05:13 AM   #1 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default 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?
delayedinsanity is offline  
Reply With Quote
Old 10-21-2009, 11:13 PM   #2 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

These could all be causes: timeout regulations, max server load, general style, page breaks..
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 10-22-2009, 03:51 AM   #3 (permalink)
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

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. :)
delayedinsanity is offline  
Reply With Quote
Old 10-22-2009, 05:33 PM   #4 (permalink)
The Visitor
 
Etheco's Avatar
 
Join Date: Oct 2009
Posts: 4
Thanks: 0
Etheco is on a distinguished road
Default

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.
Etheco is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Funny Parse -> MySQL Insert error paulOr General 6 06-05-2009 11:59 AM
MySQL INSERT INTO Bravo81 MySQL & Databases 7 06-19-2008 10:47 PM
MySQL Sell Up Alan @ CIT The Lounge 12 01-17-2008 05:46 PM
Error in connecting to MySQL via PHP EyeDentify MySQL & Databases 0 01-03-2008 01:06 PM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM


All times are GMT. The time now is 02:25 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design