rotastrain Posted July 27, 2011 Share Posted July 27, 2011 Hey people i would really appreciate advise on this i have a 10gb database 2 fields idno int primary key text longtext i need to run a simple select on this table select text from corob where idno in (1,2,3,4,5,6,7,8......upto thousand idnos) right now when i run this query it takes about 15 seconds is there any way what so ever to make this go faster. can i load something into ram?make some buffer larger?make some log?anything? also here is my explain id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE gold range PRIMARY PRIMARY 4 NULL 1000 Using where thank you for your help rota Quote Link to comment https://forums.phpfreaks.com/topic/243013-10-gb-database-select-queries/ Share on other sites More sharing options...
fenway Posted July 27, 2011 Share Posted July 27, 2011 The query takes 15 seconds to execute, or to return results? Quote Link to comment https://forums.phpfreaks.com/topic/243013-10-gb-database-select-queries/#findComment-1248197 Share on other sites More sharing options...
rotastrain Posted July 27, 2011 Author Share Posted July 27, 2011 it takes 15 seconds to return results.. in phpmyadmin it says it took 0.2 seconds but returns results after 15.. can i speed this up? Quote Link to comment https://forums.phpfreaks.com/topic/243013-10-gb-database-select-queries/#findComment-1248201 Share on other sites More sharing options...
fenway Posted July 27, 2011 Share Posted July 27, 2011 Well, that depends on how much data you're returning -- in terms of phsyical size. If the resultset doesn't fit into memory, that's not ideal. But if you're returning GBs of data via a network datastream, you're limited by lots of other things. Quote Link to comment https://forums.phpfreaks.com/topic/243013-10-gb-database-select-queries/#findComment-1248210 Share on other sites More sharing options...
The Little Guy Posted July 28, 2011 Share Posted July 28, 2011 it probably takes 15 seconds to return results because phpMyAdmin not only has to perform a query, but it also has to render a page, and if you paginate the page and are on page like 1000 it will probably return results even slower. if you run your query via command line, you will see that results return MUCH faster than phpMyAdmin, because it doesn't have to render a web page with the results. Quote Link to comment https://forums.phpfreaks.com/topic/243013-10-gb-database-select-queries/#findComment-1248729 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.