My colleague is new to Oracle and we analyze indexes on a table. This legacy and indexes currently exist in the table
Mytable * ID (primary key) * partId (Id column in part) * partNum (partNum column in part...partNum can have more than one partId) * description (description of partNum...can be different for each partNum) * dateReceived IDX_PART_ID_PART_NUM(partId, PartNum) IDX_PART_NUM(partNum) IDX_DATE_RECEIVED(dateReceived)
It looks like we have redundancy in our indices. Should I remove partNum from IDX_PART_ID_PART_NUM? Should I remove IDX_PART_NUM? As indicated above, partNum can have more than one identifier, since each part can exist more than once in an object.
Basically, in Oracle, how does an index work?
, partID partNum , . , partID, partID partNum. partNum , partNum NOT partID.
partID
partNum
: http://it.toolbox.com/blogs/confessions/post-index-how-oracle-works-10605
, . , , , , , , , .
, , PLAY EXPLAIN PLAN. .
. , , , . , , - .
, (). , 100% , , . ( Im ' , - , )
, , . partNum, - partNum . partId, partNum, , , .
partId, partNum
:
SELECT * FROM MyTable WHERE partId = 2 AND partNum = 7
IDX_PART_ID_PART_NUM, , IDX_PART_NUM. , .
IDX_PART_ID_PART_NUM
IDX_PART_NUM
, , 2 , .
, , .
, .
Querying an index is fast if you need less than 20% of the rows. Query 40% of the rows; full scan is fastest. Index requires disk, memory, insertion / update time.
In many cases, the index requires more disk and memory space than the owner table.
Another comprehensive answer: http://Use-The-Index-Luke.com
Source: https://habr.com/ru/post/1767593/More articles:Query MySQL database with timestamp - sqlMathematical calculation of matrix calculations in F # - lazy-evaluationSynthesize property errors when compiling an iPhone application - objective-cCan message-oriented middleware be used instead of MPI to coordinate distributed computing? - language-agnosticExtjs Date Check - javascriptJava java date and time values ββfrom String to Long to String - javaServlet includes runs HTTP headers in Tomcat - javaThe fastest scripting language for Java? - javaHow to make Unicode escape decoding in Antlr tokenizer - javaMagento - creating a new getProductCollection () function - magentoAll Articles