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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:26:55+00:00 2026-06-05T01:26:55+00:00

I have been thinking about two questions. Couldn’t find any resources on the internet

  • 0

I have been thinking about two questions. Couldn’t find any resources on the internet about this. How do dbms handle it ? Or do they ? Especially Oracle.

Before the questions, here is an example: Say I have a master table “MASTER” and slave table “SLAVE”.
Master table has an “ID” column which is the primary key and index is created by Oracle.Slave table has the foreign key “MASTER_ID” which refers to master table and “SLAVE_NO”. These two together is the primary key of slave table, which is again indexed.

 **MASTER**  |  **SLAVE**
     (P) ID <------> (P)(F) MASTER_ID 
                     (P) SLAVE_NO

Now the questions;

1- If MASTER_ID is an autoincremented column, and no record is ever deleted, doesn’t this get the table’s index unbalanced ? Does Oracle rebuilds indexes periodically ? As far as i know Oracle only balances index branches at build time. Does Oracle re-builds indexes Automatically ever ? Say if the level goes up to some high levels ?

2- Assuming Oracle does not rebuild automatically, apart from scheduling a job that rebuilds index periodically, would it be wiser to order SLAVE table’s primary key columns reverse ? I mean instead of “MASTER_ID”, “SLAVE_NO” ordering it as “SLAVE_NO”, “MASTER_ID”i, would it help the slave table’s b-tree index be more balanced ? (Well each master table might not have exact number of slave records, but still, seems better than reverse order)

Anyone know anything about that ? Or opinions ?

  • 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-06-05T01:26:58+00:00Added an answer on June 5, 2026 at 1:26 am

    If MASTER_ID is an autoincremented column, and no record is ever deleted, doesn’t this get the table’s index unbalanced ?

    Oracle‘s indexes are never “unbalanced”: every leaf in the index is at the same depth as any other leaf.

    No page split introduces a new level by itself: a leaf page does not become a parent for new pages like it would be on a non-self-balancing tree.

    Instead, a sibling for the split page is made and the new record (plus possibly some of the records from the old page) go to the new page. A pointer to the new page is added to the parent.

    If the parent page is out of space too (can’t accept the pointer to the newly created leaf page), it gets split as well, and so on.

    These splits can propagate up to the root page, whose split is the only thing which increases the index depth (and does it for all pages at once).

    Index pages are additionally organized into double-linked lists, each list on its own level. This would be impossible if the tree were unbalanced.

    If master_id is auto-incremented this means that all splits occur at the end (such called 90/10 splits) which makes the most dense index possible.

    Would it be wiser to order SLAVE table’s primary key columns reverse?

    No, it would not, for the reasons above.

    If you join slave to master often, you may consider creating a CLUSTER of the two tables, indexed by master_id. This means that the records from both tables, sharing the same master_id, go to the same or nearby data pages which makes a join between them very fast.

    When the engine found a record from master, with an index or whatever, this also means it already has found the records from slave to be joined with that master. And vice versa, locating a slave also means locating its master.

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

Sidebar

Related Questions

I have been thinking about this for a while and cannot come up with
I have recently been thinking about the difference between the two ways of defining
I have been thinking about the optimal way to create an XML file using
I have been thinking about a neat way of load balancing and one thing
I am looking for some input on something I have been thinking about for
I'm working on a toy game engine. I have never been thinking about coordinate
Here's something I've been thinking about: suppose you have a number, x, that can
I am after so advice really. I have been thinking about a client server
I have a problem that I have been thinking about, but I can't really
I have been thinking about a complicated view/query I need to create but I

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.