If we have to get data immediately then indexes are very helpful for us. For examples, we have to know about the peas from a book written on vegetables. In spite of studying the whole book, we will go to index, find the specific page for peas and will read it. Indexes make our work much easier. It saves our time.
Same is the method for database. If we do not use any index then the system will get through the whole table. It is very difficult. An easy way is to use index. With the help of index, system will go to the specific data and will recover it.
So, it is in our benefit to make index. One index can be used for a single or multiple columns. Here is the structure for the creation of Index in a table;
Strings get more space. But the columns related to integers, need not as much of space for saving the data.
2. Make the index shorter: Small indexes need not much space. They even take short time for execution.
3. Essential to use Column order: The index, which is used for more then one column needs the true sequence of the columns. It is better to utilize the column having fewer values. The column which has maximum values should be used at the end.
4. Index column should not be NULL: If the column for index is NULL, then the result will be in the form of error.
These suggestions can help you to minimize the size of index. The result will be quicker and in less time.