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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:17:53+00:00 2026-06-11T18:17:53+00:00

I’ve read few articles regarding indexing in MongoDb, but have not got idea over

  • 0

I’ve read few articles regarding indexing in MongoDb, but have not got idea over physical layout of records. I got used to talk about clustered (quite fast physical based) and non-clustered indexes in relational database. There are no such terms for Mongo, though their doc mentioned secondary indexes. By default it seems to create index by _id primary key witch probably corresponds to physical order of item on a storage. Please explain me: if I create one index per table does it automatically store item in the physical order according to the index? If it is not, can I somehow set it up? what about _id, does it correspond physical order by default?

  • 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-11T18:17:55+00:00Added an answer on June 11, 2026 at 6:17 pm

    MongoDB indexes are B-tree indexes. Index blocks are allocated within the same datafiles that are used to store the documents. Currently (as of MongoDB version 2.2) there is no support for any other index type beyond the standard B-tree indexes.

    Ref: http://docs.mongodb.org/manual/core/indexes/

    MongoDB makes no attempt to order documents on disk, nor to place the B-Tree index blocks in any particular order. MongoDB uses memory-mapped files to access the on-disk data structures. As a result, the question of which index blocks are in RAM and which ones are paged out is delegated to the OS memory management system.

    Ref: http://docs.mongodb.org/manual/faq/storage/

    MongoDB documents are always contiguous on disk. Any document will only be in a single physical location: it is never necessary to assemble a document from multiple disk locations.

    MongoDB initially allocates documents on disk in the order in which they have been created. If a document grows beyond it’s allocated size (via updates to that document which add new fields, sub-documents, or array elements) then the document will be moved to a new location on disk, which is big enough to hold the new document.

    Deleting documents will create ‘holes’ in the allocated space: these holes are placed on a free list, and new documents get inserted into the these holes. As a result, if you perform repeated remove() and insert() operations on a MongoDB collection, the documents will be scattered across the disk in a highly non-ordered fashion.

    In particular, documents will NOT be laid out on the disk in _id order, or in the order of any other index.

    For more information about MongoDB storage management, take a look at these presentations:

    • http://www.10gen.com/presentations/MongoNYC-2012/storage-engine-internals
    • http://www.10gen.com/presentations/mongosf-2012/journaling-and-the-storage-engine
    • http://www.10gen.com/presentations/mongosf-2012/indexing-and-query-optimization
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace

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.