What is the advantage of adding indexes in the tables in SQL [closed]

0

Hello to everyone at StackOverflow !! I hope you are well.

Regarding my query, I would appreciate knowing what is the advantage of using Indices-I understand I can have up to 250 per table-in my SQL tables and if there are cases in which they should definitely be used.

Thanking your comments to enrich the design and administration of my databases.

Gabriela

    
asked by GGs 24.01.2018 в 18:04
source

1 answer

0

The main advantage of indexes is that searches will be faster, since it avoids CPU and disk overload. However, it is not advisable to leave so many indexes in a table because the writing functions can slow down, plus you will occupy more space.

Keep this in mind before using indexes:

  
  • Any index, either good or bad, increases the INSERT / UPDATE operation time
  •   
  • Apply an index only to those columns used in WHERE and ORDER BY clauses. Creating excess indexes will result in low query performance.
  •   
  • Use the NOT NULL constraint on the columns to be indexed, to avoid null values being stored.
  •   

This added to a good standardization will allow a good performance of your BD.

    
answered by 24.01.2018 / 18:24
source