Jump to content

[Question] Servers and Queries

Recommended Posts

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?


Link to comment
Share on other sites

  • 3 weeks later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...