[Fixed]-About index and primary key in SQL?

14👍

Yes, you can assume it is a standard rule that RDBMSes require an index for the primary key.

Mainly, the database engine needs the index to enforces data uniqueness for the primary key, and to do this quickly requires an index.

6👍

Have a look at this

If a PRIMARY KEY constraint is
created for a database table and no
clustered index currently exists for
that table, SQL Server automatically
creates a clustered index on the
primary key

from SQL Server Index Tuning

4👍

In MSSQL server, creating a primary key will normally create a clustered index by default .

👤cjk

4👍

In MySQL, primary key is a type of index (particular unique index).

4👍

It tends to be the case in most RDBMSs that a primary key is implemented as an index.

This is not a requirement per-se, but a (pretty much) obvious optimization.

👤Oded

Leave a comment