DEV Community

Discussion on: What are SQL Indexes and how to create one? (For Beginners)

Collapse
 
aloksdiptim profile image
alokz diptim!

Good question Giuliovn.

Once a table is indexed based on a column field, a lookup table would be created that references the normal SQL table through the row address column.

So, for example if there are multiple instances of transaction amount, the row address in the lookup table would be pointing to the exact multiple row instance in the transaction table.

Therefore,

Select * from transaction where transactionAmount = 5000

For a multiple resultset won't be a table scan.