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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:10:03+00:00 2026-05-24T20:10:03+00:00

I am creating a rails 3 app on Heroku and it’s using postgres as

  • 0

I am creating a rails 3 app on Heroku and it’s using postgres as the database. In my rails migration I added indexes on all the ID columns. Was this a mistake? I’m starting to wonder if postgres has indexes by default on the ID columns.

If it was a mistake, how do I fix it? If I simply write a rails migration to remove the indexes from the ID columns will that fix everything?

  • 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-24T20:10:05+00:00Added an answer on May 24, 2026 at 8:10 pm

    According to postgresql’s documentation:

    Adding a primary key will automatically create a unique btree index on the column
    or group of columns used in the primary key.
    

    Hovewer, this does not prevent you from creating another index on the same columns. It might make sense if you use some different indexing policy (e.g. GiST index). But, if you are not sure about it, 99.9% that you have just created identical index.

    Actually, this will not affect application functionality at all. The only thing to be concerned is that indexes are rebuilt on update operations, so it might pose some performance related issues. So, as manual suggests removing seldom-used indexes (last sentence), you’d better remove those indexes from db.

    I’m not quite familiar with RoR migrations, but I think wriing a migration that remove those indexes is sufficient.

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

Sidebar

Related Questions

I am developing a Rails app using OmniAuth, OmniAuth-salesforce and this gem: https://github.com/heroku/databasedotcom I
I am creating a rails app and have used this code in one of
I am creating a Rails App (I'd like to know how to do this
I'm creating my first rails app, and using the standard prototype library for some
I'm following Rails Tutorial , creating a micoroposts app and pushing to Heroku. I'm
I'm creating a Rails app with Rails 3.1.3: git init git remote add heroku
This is my first rails app, one I'm creating for the sole purpose of
I'm creating a Rails app using Devise for user management (Rails 3.0.10, Devise 1.4.2).
I've created a new rails app (3.1.1) using MySQL. In database.yml, I've put in
I'm creating a Rails app for students and high schools and I'm having some

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.