Can this query be done in a simpler way?

Discussion in 'MySQL' started by Rahul Bose, Jun 28, 2010.

  1. #1
    Hello, I am new to mysql and bulding queries, I have been making this query to retrieve some specific results and it works fine. The problem is that sometimes it takes a bit longer than usual to return the results. I have asked some simular but simpler question about such query before but the suggestions didn't make any difference.

    I'd appreciate your comments.

     
    Rahul Bose, Jun 28, 2010 IP
  2. sketchx

    sketchx Member

    Messages:
    97
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    Hi,
    its hard to tune a query without having the info on the data and structure of the tables.
    How many rows in the tables??
    Which tables are optional? you should not use LEFT/RIGHT OUTER JOIN if not needed.( That, i can only tell with the tables and data struture)

    Try this, might not make much of a difference, its a start.
     
    sketchx, Jun 28, 2010 IP
  3. SportsBettingScholars

    SportsBettingScholars Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Impossible to tell if the query is efficient without knowing the full structure of the database.

    Are the any indexes defined on any of these tables ?

    If not then read up on that as it can make quite a difference in performance.
    If so have you checked with EXPLAIN if they are actually being used ?
     
    SportsBettingScholars, Jun 30, 2010 IP