Mysql Vs Javascript For Speed

liunx

Guest
Hello, Im working on some randomizing scripts to display random data. I can either use a javascript with each line being one of the entries and randomly choose and display them or I can put the entries into mysal and selct random from a database. <br /><br />Which is better for speed )which will slow the site down less).<br />Which creates less load on the server?<br /><br /><br />Also in general how many Mysql queries per page is it safe to have if you are concerned with page loading speed?<br /><br />Thanks for any input<!--content-->
Don't know which would be faster but using javascript some users will not see the content you want to display if they have it turned off in their browser. <br /><br />javascript would have less of a load on the server because it runs client side.<br /><br />As for the number of querires, I had a problem on my site where it was generating over 5000+ queries and it still displayed the page in less than 5 seconds.<!--content-->
Thanks for the info<br /><br />ok, so when you say 5000 queries do you mean 5000 mysql strings that do the query or do you mean query a databse with 5000 entries. Sorry Im new to Mysql...<br /><br />I have 8 randomizing javascripts running and I want to put in 1 mysql query in place instead. That will amek the total queries on that one page equal to 7.<br /><br />I guess I don't forsee a problem<!--content-->
5000 queries to the database. I had a bad plugin on my blog causing the problem. I only have 700 entries and 1500 comments but it queried the db 5000 times to get totals.<br /><br />I did not write the plugin so I do not know why it was doing what it was doing.<!--content-->
Thanks a lot for the help. I will move forward building the mysql query<!--content-->
<!--quoteo(post=173546:date=Apr 8 2006, 11:04 AM:name=airjunkie2000)--><div class='quotetop'>QUOTE(airjunkie2000 @ Apr 8 2006, 11:04 AM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=173546"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->Thanks a lot for the help. I will move forward building the mysql query<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br /><br />Just a follow up, I changed the javascript to mysql, and cut 4 seconds off my initially load time as alexa reports it. Deffinitely an improvement.<br /><br />Thanks again<!--content-->
 
Top