Cred Interview Question | Improve Performance

Question

What are the steps you will take to improve the performance of a poor performing query?

in progress 1
Dhruv2301 55 years 2 Answers 1066 views Great Grand Master 0

Answers ( 2 )

  1. 1) Avoid unnecessary joins
    2) Create indexes
    3) Avoid * in SELECT statement if all columns are not required.
    4) Choose appropriate DataTypes for storing data.
    5) Avoid cursors as cursors are slow in performance.

  2. 1. Use indexes efficiently
    2. Create all primary and foreign keys and relationships among tables.
    3. Avoid using Select*, rather mention the needed columns and narrow the resultset as needed.
    4. Reduce joins and heavy clauses like GROUP BY if not needed
    5. Implement queries as stored procedures.
    6. Use data types wisely
    7. Instead of NULLS use string values such as N/A

Leave an answer

Browse
Browse