airjunkie2000 Posted April 8, 2006 Posted April 8, 2006 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. Which is better for speed )which will slow the site down less). Which creates less load on the server? Also in general how many Mysql queries per page is it safe to have if you are concerned with page loading speed? Thanks for any input Quote
TCH-Bruce Posted April 8, 2006 Posted April 8, 2006 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. javascript would have less of a load on the server because it runs client side. 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. Quote
airjunkie2000 Posted April 8, 2006 Author Posted April 8, 2006 Thanks for the info 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... 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. I guess I don't forsee a problem Quote
TCH-Bruce Posted April 8, 2006 Posted April 8, 2006 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. I did not write the plugin so I do not know why it was doing what it was doing. Quote
airjunkie2000 Posted April 8, 2006 Author Posted April 8, 2006 Thanks a lot for the help. I will move forward building the mysql query Quote
airjunkie2000 Posted April 9, 2006 Author Posted April 9, 2006 Thanks a lot for the help. I will move forward building the mysql query 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. Thanks again Quote
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.