Do I need to create separate index for primary key of relational database table

偶尔善良 提交于 2019-12-06 18:29:44

问题


If I create table with primary key is index automatically created for the table or does that need doing separately.

i.e if this is the table ddl

 CREATE TABLE release(guid varchar(36) NOT NULL PRIMARY KEY,
name varchar(255),xmldata  CLOB(512 K))

do I also need to do

CREATE INDEX release_idx ON release(guid)

or not

(I'm using Derby a database that comes with Java)


回答1:


You don't need to. The primary key is already an index.



来源:https://stackoverflow.com/questions/14646014/do-i-need-to-create-separate-index-for-primary-key-of-relational-database-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!