Posts

Showing posts with the label query explain

Important things every developer need to know about Database Indexing

Assuming you know the basics of Database and know the definition of indexes used in DB, here are some important things about Database indexes about which every good developer must aware of: DB Indexing is used to read data faster, but it makes writing slower. Indexes use in-memory data structures. Indexes use B-Tree (Balanced Tree) data structure to store data and use Binary search for reading/searching. It always saves corresponding DB internal row-id (not table PK) with every indexed node in the B-tree It is not good to add an index to each column of a table. If you have applied index on certain column but in query use any function on an indexed column, the index will not help at all. You can create a combined index on multiple columns. Order matters as per query need. To understand the use of indexes or to know if the query is actually taking the benefit of your index on your column use Explain. Explain give you the execution plan of the query. Explain give you info abou...