Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6060195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:47:53+00:00 2026-05-23T08:47:53+00:00

Traditionally I have always used an ID column in SQL (mostly mysql and postgresql).

  • 0

Traditionally I have always used an ID column in SQL (mostly mysql and postgresql).

However I am wondering if it is really necessary if the rest of the columns in each row make in unique. In my latest project I have the “ID” column set as my primary key, however I never call it or use it in any way, as the data in the row makes it unique and is much more useful for me.

So, if every row in a SQL table is unique, does it need a primary key ID table, and are there ant performance changes with or without one?

Thanks!

EDIT/Additional info:
The specific example that made me ask this question is a table I am using for a many-to-many-to-many-to-many table (if we still call it that at that point) it has 4 columns (plus ID) each of which represents an ID of an external table, and each row will always be numeric and unique. only one of the columns is allowed to be null.

I understand that for normal tables an ID primary key column is a VERY good thing to have. But I get the feeling on this particular table it just wastes space and slows down adding new rows.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:47:53+00:00Added an answer on May 23, 2026 at 8:47 am

    If you really do have some pre-existing column in your data set that already does uniquely identify your row – then no, there’s no need for an extra ID column. The primary key however must be unique (in ALL circumstances) and cannot be empty (must be NOT NULL).

    In my 20+ years of experience in database design, however, this is almost never truly the case. Most “natural” ID’s that appear to be unique aren’t – ultimately. US Social Security Numbers aren’t guaranteed to be unique, and most other “natural” keys end up being almost unique – and that’s just not good enough for a database system.

    So if you really do have a proper, unique key in your data already – use it! But most of the time, it’s easier and more convenient to have just a single surrogate ID that you can guarantee will be unique over all rows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Traditionally, when we use SQL string to done some work, we have to close
I have a pretty common layout issue that I have traditionally used a table
Traditionally, our plucky team of developers have always migrated our own reports into production.
I have a product which has been traditionally shipped as an MSI file. It
I have used traditional version control systems to maintain source code repositories on past
I have traditionally implemented a Model-View-Presenter [Passive View] like so: interface IView { string
I am starting a new Winforms application, and I've always used traditional ADO.NET methods
I have good knowledge on the working of a traditional .dll . Also the
I traditionally deploy a set of web pages which allow for manual validation of
New to silverlight. Traditionally if I were to design a wizard-like process where a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.