Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to check indexes for a database or table in mysql ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 285
    Comment on it

    There are chances that you want to check for the indexes that you created on the tables in past because there can be a large number of indexes on numerous of tables depending on the size of the database

    If you want to see the indexes for a particular table

    SHOW INDEXES FROM <table_name>
    

    And when you have to see all the indexes for the complete database you have to use this command

    SELECT DISTINCT
        TABLE_NAME,
        INDEX_NAME
    FROM INFORMATION_SCHEMA.STATISTICS
    WHERE TABLE_SCHEMA = 'your_database_name';
    

    Removing the where clause will show you all indexes in all databases.

 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: