Should I index primary key column(s) in Oracle

前端 未结 1 1738
遇见更好的自我
遇见更好的自我 2020-12-16 12:33

I\'ve recently stopped to think that Primary Keys are not indexes, they\'re a combination of Unique and Null constraints. And till now, I\'ve never created index for PK colu

相关标签:
1条回答
  • 2020-12-16 13:25

    Oracle will create an index for you, or can use an existing one. Whether a unique or non-unique index is used is up to you.

    http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm#i1006566

    A primary key itself is not an index, and nor is a unique constraint -- they are both constraints. However an index is used to support them.

    A unique index is rather different as it can exist in the absence of a unique or primary key constraint, and neither constraint type require that the index supporting it be unique.

    0 讨论(0)
提交回复
热议问题