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 7646149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:08:05+00:00 2026-05-31T10:08:05+00:00

With MySQL, instead of auto-creating the rowid field as done on PostgreSQL, the slug

  • 0

With MySQL, instead of auto-creating the rowid field as done on PostgreSQL, the “slug” field:

slug = models.SlugField(primary_key=True, max_length=128)

is used in JOINs, as the “id” field is not created at DB level. The implications are that when doing JOINs the “slug” FK is used, with string data! Of course this is very expensive compared to JOINs using integers.

How do I have Django creating the db-level ID field on MySQL as automatically happens on PostgreSQL?

  • 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-31T10:08:06+00:00Added an answer on May 31, 2026 at 10:08 am

    You can only have one primary key per table. Since you’ve created one yourself, the ORM does not create one for you.

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

Sidebar

Related Questions

How can I make MySQL auto increment in 4 digit format? So instead of
MySQL stores the date in my database (by default) as 'YYYY-MM-DD' The field type
I'm creating my own recipe box using php/mysql and one part I'm stuck on
I'm trying to migrate my app from MySql to Postgresql, using Rails3-pre and the
How can I insert a NULL value into a database field (MySQL) with char(2)?
Usually I would have a table field called ID on auto increment. That way
My MySql table is returning days instead of time. I need a minimum level
mysql> select count(*) from table where relation_title='xxxxxxxxx'; +----------+ | count(*) | +----------+ | 1291958
Mysql: Table_A ------------ id name 1 Name1 2 Name2 Table_B ------------ a_id type value
Mysql's environment is following: character_set_database=big5 And when I send a SQL which contains tranditional

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.