Issue Details (XML | Word | Printable)

Key: SERVER-1054
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Mathias Stearn
Reporter: Kenny Gorman
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Core Server

Ability to see block_id where object is stored

Created: Apr 26 2010 05:21 PM UTC   Updated: May 28 2010 12:03 AM UTC
Component/s: Performance
Affects Version/s: None
Fix Version/s: 1.5.2

Backport: No


 Description  « Hide
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


 All   Comments   Change History   git Commits      Sort Order: Ascending order - Click to sort in descending order
Eliot Horowitz made changes - Apr 27 2010 04:07 PM UTC
Field Original Value New Value
Fix Version/s 1.5.2 [ 10143 ]
Priority Major [ 3 ] Minor [ 4 ]
Eliot Horowitz made changes - Apr 28 2010 03:42 PM UTC
Assignee Eliot Horowitz [ eliot ] Mathias Stearn [ redbeard0531 ]
auto added a comment - May 11 2010 07:12 PM UTC
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

Mathias Stearn added a comment - May 11 2010 07:14 PM UTC
>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.

Mathias Stearn made changes - May 11 2010 07:14 PM UTC
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Kenny Gorman added a comment - May 11 2010 07:25 PM UTC
*excellent* Thanks!

Eliot Horowitz made changes - May 28 2010 12:03 AM UTC
Status Resolved [ 5 ] Closed [ 6 ]