MySQL Join's issue with keys

Discussion in 'MySQL' started by flamer, Apr 4, 2010.

  1. #1
    JOINS
    Current join_buffer_size = 132.00 K
    You have had 627 queries where a join could not use an index properly
    You have had 4 joins without keys that check for key usage after each row
    You should enable "log-queries-not-using-indexes"
    Then look for non indexed joins in the slow query log.
    If you are unable to optimize your queries you may want to increase your
    join_buffer_size to accommodate larger joins in one pass.

    Note! This script will still suggest raising the join_buffer_size when
    ANY joins not using indexes are found.


    This is an outcome from a MySQL optimizing script. I don't get the point in red. What exactly is it telling me to do?
     
    flamer, Apr 4, 2010 IP
  2. peoplesmind

    peoplesmind Active Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #2
    You've got a query which requires mysql to scan the whole tables for the information as opposed to using an index (a key). you can add indexes on the columns you need if your script makes that query a lot. each time that query is made, mysql will then check the table for a key again before moving on to the next row (in order to process the next row faster). this will slow down the time it takes to perform the query.
     
    peoplesmind, Apr 5, 2010 IP
  3. flamer

    flamer Peon

    Messages:
    757
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So what exactly is the solution to it? What are the settings required in my.cnf ?
     
    flamer, Apr 5, 2010 IP