[SERVER-1054] Ability to see block_id where object is stored Created: 26/Apr/10  Updated: 12/Jul/16  Resolved: 11/May/10

Status: Closed
Project: Core Server
Component/s: Performance
Affects Version/s: None
Fix Version/s: 1.5.2

Type: New Feature Priority: Minor - P4
Reporter: Kenny Gorman Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

In various other RDBMS products we can query to see where a given row lives on disk. The idea is that one can monitor and effect the placement of data to be efficient when scanning many rows at once. For example imagine a photo gallery with 100 photos where the application does a logical:

select * from pictures where user_id = 10; / db.pictures.find("user_id":10)

One would want all picture rows in the same block so that only three block fetches are required. Two for index then one for the data payload.

See this pastie for example:

http://pastie.org/936239



 Comments   
Comment by Kenny Gorman [ 11/May/10 ]

excellent Thanks!

Comment by Mathias Stearn [ 11/May/10 ]

>db.foo.find().showDiskLoc()
{ "_id" : 0, "$diskLoc" :

{ "file" : 0, "offset" : 39446192 }

}
{ "_id" : 1, "$diskLoc" :

{ "file" : 0, "offset" : 39446228 }

}
{ "_id" : 2, "$diskLoc" :

{ "file" : 0, "offset" : 39446264 }

}
...

Drivers will need to be updated to add support for the $showDiskLoc query option. If you need support for a particular driver, please file a case under that jira.

Comment by auto [ 11/May/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: $showDiskLoc query option SERVER-1054.
Implementation is a bit ugly. Please code-review and let me know if there is a better way
http://github.com/mongodb/mongo/commit/f99aba9824adf754609239274e91a9bdbd8e4cce

Generated at Thu Feb 08 02:55:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.