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

  • Home
  • SEARCH
  • 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 504767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:31:47+00:00 2026-05-13T06:31:47+00:00

It may looks a naive question but I am wondering about the relationship between

  • 0

It may looks a naive question but I am wondering about the relationship between primary keys and indexes in most common SQL databases.

Is it a standard rule for a SQL database to create automatically an index for every primary key?

I am asking that because I am designing a model with Django and I am wondering if it is redundant to set both primary_key=True and db_index=True.

  • 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-13T06:31:48+00:00Added an answer on May 13, 2026 at 6:31 am

    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.

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

Sidebar

Related Questions

My question may look naive but I do not know how to formulate it
This may seem like a basic/stupid/obviously-answered question, but I wanted to check: why use
I am new to JRules coding.It may looks like a simple question. I would
The html structure looks like this <div id=parent> parent may contain text <div id=child1>
I'm trying to parse a log file that looks like this: %%%% 09-May-2009 04:10:29
I know this question was asked for many times, and it may look like
The element tasklist may contain at most one title and at most one description
I have always wondered about this but quite never got to understand why. We
I am trying to do gem install of mysql2 but it looks like it
I'm wondering what are the main differences between developing for iPhone on a Mac,

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.