Tuesday, 14 March 2017

[MongoDB] MongoDB performance note




Note:


  •        Foreground index builds block all reads and writes to the collection being indexed.
  •        Foreground index builds block all reads and writes to the database that holds the collection being indexed.
  •        Background index builds take longer to complete than foreground index builds.


  • MongoDB's query optimizer is statistically based, where collection heuristics are used to determine which plan wins.
    No, MongoDB has an empirical query optimizer where query plans are ran against each other during a trial period.
  • Query plans are cached so that plans do not need to be generated and compared against each other every time a query is executed.
    Yes, that is correct.
  • When query plans are generated, for a given query, every index generates at least one query plan.
    No, only a subset of the indexes are considered as candidates for planning.
  • If an index can't be used, then there is no query plan for that query.
    No, if there aren't any viable indexes for a given query, then a COLLSCAN stage will be the main stage of the query plan.

No comments:

Post a Comment

how-to-recursively-create-subfolder-in-each-folder-of-a-directory-in-cmd

test.cmd: @echo off setlocal for /f "usebackq tokens=*" %%a in (`dir /b /a:d`) do ( rem enter the directory pushd %%a echo...