Oracle Index Sort Order and Attachment

I have 2 tables that represent several million rows with indexes. I want to convert one of the indexes to DESC order in order to optimize some operations. However, will this affect the connection speed or other optimizations?

For instance:

Table A:
a_id (pk)

Table B:
b_id (pk)
a_id (fk)

If A.a_id is stored as DESC and B.a_id is stored in ASC, will I encounter any problems or slowness when connecting? Can the oracle use indexes to join even if they have different sort orders? Should I also do B.a_id DESC or create a second index that is DESC? Obviously, I would like to try a simple experiment, but I don't have access to DBA or oracle backup installation to work.

+3
source share
6 answers

Will Oracle be able to use indexes for joining, although they are different sort orders?

" ". . . , , - , , , . , , ; , , .

, A.A_ID, ( , ), .

: . , , , , . , , , , . , , - , . - - - .

+4

Oracle , , ASC DESC .

DESC - , , , . , colA ASC, colB DESC, (colA, colB DESC), .

+2

, , - "" . ORDER BY, .

, - .

, "", , ,

0

? . Oracle , , , .

, , . . . .

0

asc/desc, 2 asc/desc order .

, desc, , , 90-10 ( ), desc 50-50 split , .

DESC , , asc, - desc, .

0

Early optimization is a waste of time. Just leave this problem and do the following. When this table has 100 million rows, change the indexes and check what happens, and until then your ten rows of data are not worth the time to “optimize”.

-1
source

Source: https://habr.com/ru/post/1778762/


All Articles