Indexing is a technique used in databases to optimize query performance by minimizing disk accesses. It creates a data structure to quickly locate and access data. Indexes have attributes like access time, insertion/deletion time, and space overhead. There are different types of indexes including dense indexes with an index record for every search key, sparse indexes with records only for some keys, clustered indexes that store related records together physically, and non-clustered indexes that are separate structures reordering columns.