Showing posts with label mongoDB. Show all posts
Showing posts with label mongoDB. Show all posts

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.

Wednesday, 1 March 2017

Upgrade to the Latest Revision of MongoDB in windows

Upgrade to the Latest Revision of MongoDB in windows

First, My mongodb is very simple- single DB so I just follow the instruction -

https://docs.mongodb.com/manual/tutorial/upgrade-revision/  -
Replace the Existing Binaries

  1. Download the binaries for the latest MongoDB revision from the MongoDB Download Page and store the binaries in a temporary location. The binaries download as compressed files that uncompress to the directory structure used by the MongoDB installation.
  2. Shutdown the instance.
  3. Replace the existing MongoDB binaries with the downloaded binaries.
  4. Restart the instance.

My steps :
          1. I download the latest revision of MongoDB -3.4. 
          2. Install MongoDB 3.4 
      3. change path
          3.1 control panel
          3.2 System --> Change settings
          3.3 Advanced --> Environment Variables...
          3.4 System Variables -->[Path]
       


         3.5. change MongoDB path from 3.0 to .3.4 and then save. 
         

         3.6 open command prompt (cmd) and check version --- Mongod -version

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...