Indexing in SQL -


My table has 10 columns .... What column do I choose to create an index? Is there a guideline rule to do this? What are the disadvantages of indexes? What if I update the column which is part of the index? Does this reduce performance of INDEXES?

from other posts: < Answers for / p>

1.1 You should make indexes on columns that are often used in the WHERE section.

1.2 You should be indexed on the columns you use repeatedly to come into the columns.

1.3 You should make indexes on columns that are often used

1.4 You get indexed on the columns The table should contain some of the same values ​​or unique values.

1.5 You should not index small tables (tables using only a few blocks) because a full table scan can be faster than the indexed query.

1.6 If more than one column is often used in the WHERE section in a converged index, then first create the most selected columns, pre-create in the index statement.

1.7 column has many nulls and you do not search for zero-value values.

1.8 The primary and unique key is automatically indexed, but you can create an index on a foreign key;

Answer to Question 2:

2.1 Previous rule

Question 3 Answer:

3.1 If you do not accept the previous advice, the index interrupts the good performance of a database

< Strong> Answer for question 4 and 5:

4.15.1 Do not modify index columns often, modify the subsequent columns and modify the ECSRT and the delete statement Which series Modify the tables, if there is no index, such SQL statements should modify data in the table as well as data in the table. They also generate additional undo and reproduction.


Comments

Popular posts from this blog

objective c - iPhone and it's wireless area -

multithreading - Do lock objects in Java need to be static? -