The error of indexing using indexes six: indexing all columns
We know that indexing is an effort to improve query efficiency, but it should also be noted that indexes increase the cost of DML operations (INSERT, UPDATE, delete), and that most indexes are not used at all if there are too many indexes in them. On the other hand, we maintain these are not used, so we have to significantly reduce the performance of the system. Therefore, the more the index is not the better, but the right to use.
For example, some columns, because of the use of functions, it is not possible to use an existing index (such as some composite index) (see the previous "function index" in detail), then a separate function index must be established, if that function index is rarely applied (only in a few special SQL), We can try to rewrite the query without establishing and maintaining that function index, for example:
C:\>sqlplus Demo/demo
Sql*plus:release 9.2.0.1.0-production on Sun Oct 17 07:47:30 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
In general, in order to balance the efficiency of the query and the efficiency of DML, we have to carefully analyze the application, to find a relatively high frequency, less field content (such as VARCHAR2 (1000) is not suitable for indexing, and VARCHAR2 (10) relatively suitable for indexing) of the column, reasonable to establish the index , like sometimes we want to build a composite index, and sometimes we prefer to build a single key index.
In fact, Oracle's index has many topics, such as monitoring the use of indexes, Oracle 9i launched the skip scan, and so on, in the next discussion, we will elaborate on these topics.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.