Results 1 to 8 of 8
  1. #1

    How man queries are too many?

    Lame, i mispelled in the title.

    In the long run, how many queries on a game would be too many? Assuming the queries are optimized.
    In an ajax game this number would most likely be increased, but in this day and age, what is really just too many? Basically when the cpu load is super high eh?
    Last edited by runthis; 07-24-2011 at 06:57 PM.
    To truly bake a cake from scratch. You must first recreate the entire universe.

  2. #2
    there is not a straight answer to that, as it depends on the server, how it prioritizes the requests, the mysql settings (max connections, etc), the queries themselves and how they are constructed...
    overall there is no way on answering to that without a full knowledge on the environment that the db's are running.
    Quote Originally Posted by Spudinsky
    A little philosophy on this matter:
    My posts are my opinion, whomever disagrees with it is *their* problem not *mine*.

    AWESOME NEW WEBSITE http://tinyurl.com/30j9

    /* You laugh at me because i'm different. I laugh at you because you're all the same. */

  3. #3
    Lets assume everything is standard, apache 2.2 on an average server with no other websites using latest php/mysql.
    To truly bake a cake from scratch. You must first recreate the entire universe.

  4. #4
    Again there is no single answers. For a short answer: too many queries is when the game starts to be slow. Now you could have one single slow query or many very fast one... so all depends on your design we can't answer like that.
    - Make Web Games Administrator
    - Creator of NWE
    - Owner of Nowhere Else and beyond
    - Mad developer

  5. #5
    To be honest it's not just your queries you should be worrying about as it's one part of it, you should time the execution of your scripts to see if they are slow for any reason. Of course there is no set bench mark for this (that I really follow anyway), but if something like a query or a loop is 90% of the load time it's then fairly easy to see that's what you should be looking into to. You can also have a read over this - http://www.makewebgames.com/showthre...Code-profiling
    Last edited by Dominion; 07-25-2011 at 11:03 AM.

  6. #6
    As many as you need is the correct amount.

    An ajax game would not increase it at all. IF you had to query two tables for the something, there really should be some kind of join between the two thus making it just one query.
    Last edited by SirChick; 04-06-2012 at 04:26 PM.

  7. #7
    If in doubt enable slow log queries and use mytop if the situation is really bad.

    I can highly recommend if you can use splunk
    Ruler of Zu

    FIA ISP FTW!

    MWG a discussion forum. If you do not like replies then perhaps dont start a topic.

    I no longer support Mccodes bugs, errors or security flaws either on the forum or by private message due to the lack of support by the mccodes staff for their own engine.

    If your looking for an engine get one thats supported by its staff. EzRPG and EzRPG Rework & NWE are my recommendations.

  8. #8
    There isn't something such as too many queries.
    A single query could be made up of five or ten sub-queries.

    As long as you are using your DBMS wisely and optimize your queries as best possible, you can have millions within a single application.
    Another thing, you do get to a point within your application where queries begins to be resource intensive.
    That is the point where you rethink your current database design, and implement either a query cache, use DBMS replication servers or implement a load balancing scheme.

    I'd say if your query executes in less than a second on average, you're doing quite all right.
    (Note: this depends on many factors, but for un-indexed tables an average of 2.5s on complex queries is completely normal)
    PHP is my wife, but JavaScript is my mistress.
    I only troll here if I have nothing better to do.

    ezRPG (latest) | ezRPG Rework (latest)

Similar Threads

  1. Queries on each page
    By SHAD in forum General Discussion
    Replies: 2
    Last Post: 04-23-2011, 08:48 PM
  2. Mysql 500 + queries?
    By gurpreet in forum MySQL, Oracle, Postgress or other DB
    Replies: 10
    Last Post: 01-17-2010, 07:52 PM
  3. Sql queries
    By kingarmy in forum General Discussion
    Replies: 4
    Last Post: 03-22-2009, 12:15 AM
  4. SQL Queries
    By The Ace in forum General Discussion
    Replies: 6
    Last Post: 04-08-2008, 07:44 PM
  5. QUERIES
    By jimmytubbs in forum General Discussion
    Replies: 7
    Last Post: 03-08-2008, 05:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •