Machine-translated by Google. Questions are authored in English.
Top

Discussion

Indexes can usually be created for both primary and secondary keys.

  • A.True
  • B.False

Answer: A

Correct answer: True

An index can be created on any column or set of columns, whatever its role in the design. The primary key is normally indexed automatically, since the engine needs an index to enforce uniqueness efficiently, and secondary keys are indexed on demand.

The reason for indexing a secondary key is the same as for the primary: a column frequently used in WHERE clauses or joins is expensive to search without one. The cost is space and slower writes, since every insert, update and delete must maintain each index.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.