Is performance better with no primary key?

In some environments, with millions of rows of data on the tables, that there are no primary keys. They are using just indexing for reporting applications. Is this most efficient for read only environments?

more ▼

asked Dec 06, 2017 at 09:15 PM in Default

avatar image

1.4k 100 114 121

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

It's the good old answer of "It depends".

You don't always need a primary key, a clustered index is more important. You only need a PK if your doing things like replication, or foreign key constraints, but they can get around with a unique key.

Does the table have a clustered index? Are the indexes that are defined sufficient to satisfy the queries being run?

more ▼

answered Dec 07, 2017 at 09:21 AM

avatar image

3.1k 1 4 6

Yes. Clustered Indexes. Regarding query sufficiency, that was my question. I was asking to see if it's been determined that queries run faster when tables are created with primary keys. Thank you for your response

Dec 07, 2017 at 05:46 PM technette
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Dec 06, 2017 at 09:15 PM

Seen: 51 times

Last Updated: Jan 03 at 12:18 PM

Copyright 2018 Redgate Software. Privacy Policy