plusnplus Posted March 17, 2010 Share Posted March 17, 2010 Hi, I have very long query in mysql using php. in apache already set the time out very long, 1000000. but still the process stop just about 1-2 minute. is in mysql also have setting i should change the value of time-out? thanks for any reply/ help Quote Link to comment https://forums.phpfreaks.com/topic/195528-is-in-mysql-have-timeout-setting/ Share on other sites More sharing options...
dreamwest Posted March 17, 2010 Share Posted March 17, 2010 I doubt the single query is taking 2 mins, unless your joining a blog field without indexing it Can you post you "super" query here? Quote Link to comment https://forums.phpfreaks.com/topic/195528-is-in-mysql-have-timeout-setting/#findComment-1027477 Share on other sites More sharing options...
plusnplus Posted March 17, 2010 Author Share Posted March 17, 2010 Hi dreamwest , thanks for the reply. the query is just normal query: - select 16 field - with 4 condition - from 1 table - sort by 6 field estimated record to be display -+ 12.000 records i'm using normal pc : intel core 2 duo, e8400 @3 ghz, 2gb ram sata harddisk 250 gb. win xp apache 2.0 php 4.0 mysql 4.0 if i make more condition in query, the result can get full -+ 1000-1500 records, but once i reduce the query condition, the broswer always stop in 1800 plus record. btw, how to indexing record in the table? Quote Link to comment https://forums.phpfreaks.com/topic/195528-is-in-mysql-have-timeout-setting/#findComment-1027493 Share on other sites More sharing options...
dreamwest Posted March 17, 2010 Share Posted March 17, 2010 No wonder its timing out you 12,000 rows in one hit. 2 solutions: one is to query 20 rows at a time and use LIMIT 1,20, "SELECT * from table LIMIT 1,20" the second is to add a tmp field in the table and make it tinyint, then just select and update rows where tmp ='0' "SELECT * from table WHERE `tmp`='0' LIMIT 1,20" after successful query update the tmp field to 1 Quote Link to comment https://forums.phpfreaks.com/topic/195528-is-in-mysql-have-timeout-setting/#findComment-1027498 Share on other sites More sharing options...
plusnplus Posted March 18, 2010 Author Share Posted March 18, 2010 Hi dreamwest , it is something statistic record that need display in full -+ 12,000 records. records in table actually more then 60,000 records. is mysql not the right one to do the job? or there is setting to make longer timeout beside one in apache setting? btw, how actually 'LIMIT 1,20' working ? when i try it, it only display 20 record, but the sum of 12,000 records still calculate and show. Quote Link to comment https://forums.phpfreaks.com/topic/195528-is-in-mysql-have-timeout-setting/#findComment-1027909 Share on other sites More sharing options...
fenway Posted March 22, 2010 Share Posted March 22, 2010 That's php's fault. Quote Link to comment https://forums.phpfreaks.com/topic/195528-is-in-mysql-have-timeout-setting/#findComment-1030170 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.