opalelement Posted March 8, 2009 Share Posted March 8, 2009 So I have 4-5 tables in a MySQL database which will be very large, and every night I will be using a cron job to update these. To give an estimate, the longest one lasts about 5min to add everything to a fresh table and the shortest takes about a minute. Once they are in, data will rarely be added; it will mainly only be updated. My questions are: 1) What would be more efficient, set_time_limit very high and running all of them in the same script, or taking care of each table in a different script and running the cron jobs at the same time? I don't want to do the "set them 5 min apart" method, as the data corresponds to data in each table and I want it to go as fast as possible. 2) Would it be more efficient to update the data every night, or to erase the table and restart it with the new data (which is coming from a .txt.gz file, each row is separated by \n and columns are comma-delimited)? Link to comment https://forums.phpfreaks.com/topic/148434-two-simple-questions-about-efficiency/ Share on other sites More sharing options...
WolfRage Posted March 8, 2009 Share Posted March 8, 2009 Just a guess but probably much faster to start the tables from scratch. Because if you do not, you have to query the tables for the needed updates and then make the replacements as needed. But there will be lag time between updates, and it would probably be fastest if you just passed all of the information in a .sql file to the database. Link to comment https://forums.phpfreaks.com/topic/148434-two-simple-questions-about-efficiency/#findComment-779289 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.