Get the App
SLTechnology News&Howtos  ›  Database  › 

MongoDB performance test code

Shulou Source: shulou.com Published: 2022-06-01 15:05:11 10月04日 Update

Write 1 million records, build an index, and use the index for 100000 consecutive queries.

Use admin;// connection database db.auth ("mongoAdmin", "123456"); / / log in to use test;// connection test library db.test_collection.dropIndexes (); db.test_collection.drop (); print ("insert begin:" + Date ()) / / write start time people = ["Marc", "Bill", "George", "Eliot", "Matt", "Trey", "Tracy", "Greg", "Steve", "Kristina", "Katie", "Jeff"]; for (var item10; I

Tags: Time index query performance test one line multiple computer note notebook cluster ordinary ten thousand memory that is results data database speed guarantee Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Microsoft Xiaomi Linux NVidia