Rudra
Rudra

Reputation: 1688

mongoDB Database Profiler query and getmore options

I am currently using [email protected] in one of my project. I started mongo profiler in the database instance and wanted to check how my queries are performing. I got the result from system.profile collection. The possible values for the system.profile.op can be

insert, query, update, remove, getmore, command

Can someone please tell me, what the query and getmore options does. The mongo documentation is of no help in figuring out the same

Upvotes: 1

Views: 688

Answers (1)

Blakes Seven
Blakes Seven

Reputation: 50416

There are basic explainations for these terms as they are intended to be somewhat descriptiive in themselves. But here is a general summary:

  • query: Is of course any "query" operation on the database that is happening on the database, or the "R" in "CRUD" where operations are sent to "Read". You will generally find that these operations along with the "command" operations have the longest execution times

  • getmore: Is quite aptly named because it "gets more". It is the number of times a "cursor" batch is called from the server. Each "query" return results as a "cursor" which is in turn fetched in "batches" of those results from the server.

Both of these counts are generally related and will be a typical part of normal reading operations. "Spikes" in these counts will also occur when replication is being done between nodes, as secondary nodes are basically "querying" the primary node for updated information

There is also some "brief" information on this in the mongostat manual page, which produces related results to what is reported in the profiler.

Upvotes: 3

Related Questions