I think this is set on a server to server basis, but was wondering if there's an average maximum size limit on an SQL query. Anyone have any idea?
I'm working up a mod that's got a big ol' INSERT (2.7MB) and was wondering how many users might have trouble with this...
I know the query could be separated out, but this is neither the goal nor the intention. The install depends on users being able to handle an INSERT of this magnitude.
Any ideas on a typical maximum?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 07:01 AM
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 06:41 AM
- ehdwma created topic »Hide "Register new account" and change template to 3 col« 06:27 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Average max sql INSERT query??
-
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2204
text or blob John? ph has a config option for default timeout, but there are ways of dealing with that on a per file basis.
PS: check out the banner competition.. link below.. its a chance to let your skills out of the bag in a showcase and maybe make a few bucks doing so :) -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
It's just a basic text file... file.sql...
I'm running it in the pninit.php file after the table is created. I was thinking that setting the set_time_limit(0) would do the trick, but this white-screens the init function (though it does populate the DB.) How can I set the script execution time to whatever it takes... ie, temporarily turn it off even...?
I'll check out the banner competition! Love competitions!! -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2204
..that's a rough spot to be testing.. deleting, remoiving, blah, blah, blah :) ..
I'd try calling sleep(1); and maybe ignore_user_abort(); but AFAIK, queries aren't considered part of script execution, so I'm not sure if set_time_limit(); is helping or not.. no log errors on that white screen? -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
Lol...It's not such a bad place to test...I'm inserting a boat-load of data, loaded from split files... and looping through the files systematically...this works fine. I've stripped the individual files down to 3 inserts per file for testing purposes... but in the release version, the largest SQL file that's being run is going to be 2.7Mb...the others are comparable...so I just needed to be sure that the largest was going to pan out for most users... -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
...hmm... must of been a temp snafu... It panned out this time ... coming obediently back with a status message and the module admin page... (keeping in mind that my 4 SQL files are 3 inserts apiece for the test...but that shouldn't matter...) -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
Question... I've got the init script pulling the SQL files, running the INSERTS and it works pretty well...but I have the DB prefix hardcoded into the SQL files. In other words, it works fine on my dev site, but when others try to init the mod, having the prefix hardcoded will fubar the script...
The files I'm using to store the queries are named like so:
a.sql
b.sql
c.sql
d.sql
etc...
Here's a look at my test script...pay no attn. to the die()...it's temp.
Code
set_time_limit(0);
$P2Mod = (dirname(__file__));
$letters = range('a','d');
foreach($letters as $letter)
{
$file = $P2Mod.'/pnsql/'.$letter.'.sql';
if(file_exists($file))
{
foreach(file($file) as $sql)
{
$dbconn->Execute($sql) or die(mysql_error());
}
}
}
I don't want to have users have to search/replace the DB prefix in all the files...but don't know what else to do...
This is for a pnAPI dictionary mod...which stores the dictionary in the DB. I know there are other mods out there, and yes, I know storing the dictionary in the DB isn't the best method...but it's the best way to ensure that it's dependable and always available... ie, no off-site reliances... -
**unknown user**
- Rank: Senior
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 2330
I did a test run on the entire she-bang...it took apx. 4 minutes to initialize the module, but initialize it did! 175,000+ records inserted...and it returned no errors...SWEET!
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
