UCC Posted February 21, 2007 Share Posted February 21, 2007 So I've heard that when it comes to shared hosting, some companies get pissy if you have a bunch of queries to the DB. In that regard, I've tried to limit this as much as possible. One question I have, however is as follows..... Do complex queries, accessing multiple tables with JOIN SQL statements, create less server issues than multiple queries to the DB? Thoughts? Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted February 21, 2007 Share Posted February 21, 2007 Re: Question: Servers and Queries should do, especially if you have effective keys on them but i can't be too sure, i usually try and keep my query count down even if i have to access 4 or 5 tables in one go Quote Link to comment Share on other sites More sharing options...
awakenedlands.com Posted March 10, 2007 Share Posted March 10, 2007 Re: Question: Servers and Queries The number of queries and the complexity of a query both have the same effect -- load time lag. Just take all the queries you have on a given page and run them in phpmyadmin's SQL tab. This will give you a query load time in seconds. Add them up. Or add in a microtime page load script for your pages to find out what taking too long. Proper indexing of tables for commonly used data is important. There are plenty of unindexed tables in the default game code that make what should be a 0.2 second page turn into a 2.5 second page. I've posted on here in the past that adding indexes to certain tables basically saves you the need of getting a dedicated server. I'm sure there are plenty of mccode games out there on dedicated servers that get poorer performance than a shared host game with optimized tables. The hosts that get pissy with your SQL use probably oversold their server space and don't want your activity on the servers. Otherwise they wouldn't care. Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted March 11, 2007 Share Posted March 11, 2007 Re: Question: Servers and Queries i just get amazed at how many people use $count=mysql_query("SELECT * FROM users WHERE blah = 1"); if (mysql_num_rows($count) etc using COUNT(*) in the query saves loading the whole table into memory Quote Link to comment Share on other sites More sharing options...
mdshare Posted March 16, 2007 Share Posted March 16, 2007 Re: Question: Servers and Queries lol deception don't tell all the secrets ;) there is a nice tool called google Quote Link to comment 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.