Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to speed up the mysql Query

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 224
    Comment on it

    Hello Readers,

    If you want to speed up the mysql query or optimize the query:

    Below are some points to follow while writing the mysql query:

    1. Always every table must have a Primary Key. Primary key is very essential for mysql operation
    2. While creating a table, you should keep the entire column as NOT NULL. Making the entire column as NOT NULL will avoid NULL entry into the column.
    3. While making the connection always use persistent database connection .
    4. Use LIMIT in SELECT query. It will make fast your query.
    5. While writing JOIN Query, make sure that both columns should have same datatypes.
    6. Never use ( * ) in SELECT query, Try to use the column names.
    7. We should avoid HAVING clause while use query because it can slow our query.
    8. While writing ORDER BY, We should write column name instead of writing any function like RAND, COUNT. It will slow our query.
    9. When loading a table from a text file, use LOAD DATA INFILE.It faster the result.
    10. .Increase buffers size.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: