Follow us on: facebook twitter linkedin

DATABASE

Indexing in SQL

Post by : John deo
Post date: 2024-05-26 13:29:47

Read time : 5 minute
Total views: 324 times
hero-img

SQL Indexing 

Indexing optimize SQL searching or selecting query than normal query. For large amount of data when we run searching or selecting query its take time. Reducing thats time we should use SQL indexing.

 

Add index below columns

  1. Where searching is used freequently.
  2. Columns freequently used for where clause.
  3. Columns freequently use for join, group by, order by.

Avoid index below columns

  1. Columns freequently update.
  2. Columns not use in query.
  3. Columns contain large text value.

Create show and drop index query

CREATE INDEX index_name ON table_name (column1, column2, ...)

SHOW INDEX FROM table_name

DROP INDEX index_name ON table_name

Share by:

Keep exploring

Read what excites, achieves and moves us Read what excites, achieves and moves us