0% found this document useful (0 votes)
7 views5 pages

Mongodb m201 Performance v1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 5

Nombre:

Fecha: Firma:

Curso: MongoDB
Rendimiento

Ámbito de la prueba
Esta prueba de nivel de tipo test verifica el conocimiento de los temarios:
• Rendimiento

¿Cómo cumplimentar la prueba?


Escribe tu nombre y fecha en la parte superior de esta página.
Cada pregunta indica la cantidad de respuestas correctas que deben ser marcadas.
Usa este mismo documento para marcar tus respuestas.
Utiliza bolígrafo, u otro medio de tinta permanente para contestar la prueba. Preferible
tinta azul o negra, pero no roja.

¿Cómo marcar las respuestas?


Las preguntas tienen una única respuesta posible, excepto las que indican
explícitamente la cantidad de respuestas necesarias.
Rodea con un círculo  la(s) respuesta(s) que consideres correcta(s).
Si te confundes, tacha con una X la respuesta errónea y marca con un nuevo círculo la
correspondiente.
Si vuelves a cambiar de opinión y pueden quedar dudas de la respuesta marcada, añade
una flecha → a la izquierda del círculo, indicando la respuesta elegida.
Si vuelve a modificarse la respuesta, indica con un texto en el espacio disponible bajo la
pregunta, la(s) letra(s) correspondiente(s). Ejemplo: RESPUESTA: ac

Cuestionario:

1) Introduction: Hardware Considerations & Configurations


Regarding the performance implications, which of the following
statements are correct?
a. MongoDB does not benefit from adding more RAM to your servers.
b. Disk RAID architecture can impact the performance of your MongoDB
deployment.
c. Switching from HDDs to SSDs does not bring a benefit to the
performance of MongoDB.
d. CPU availability impacts the performance of MongoDB, specially if
using the WiredTiger storage engine.

2) MongoDB Indexes: Introduction to indexes


Which of the following statements regarding indexes are true?
a. Indexes are used to increase the speed of our queries.
b. The _id field is automatically indexed on all collections.

Página 1 de 5 examen_mongodb_nf40 m1 v1
c. Indexes reduces the number of documents MongoDB needs to examine
to satisfy a query.
d. Indexes can decrease write, update and delete performance.

3) MongoDB Indexes: Single field indexes


Which of the following queries can use an index on the zip field?
a. db.addresses.find( { zip : 55555 } )
b. db.addresses.find( { city : "Newwark", state : "NJ" } )
c. db.addresses.find()

4) MongoDB Indexes: Sorting with indexes


Problem:
Given the following schema for the products collection:
{
"_id": ObjectId,
"product_name": String,
"product_id": String
}
And the following index on the products collection:
{ product_id: 1 }

Which of the following queries will use the given index to perform the sorting of
the returned documents?

a. db.products.find({ product_id: '57d7a1' }).sort({ product_id: -1 })


b. db.products.find({ product_name: 'Soap' }).sort({ product_id: 1 })
c. db.products.find({}).sort({ product_id: 1 })
d. db.products.find({ product_name: 'Wax' }).sort({ product_name: 1 })
e. db.products.find({}).sort({ product_id: -1 })

5) MongoDB Indexes: When you can sort with indexes


Which of the following statements are true?
a. Index prefixes can be used in query predicates to increase index
utilization.
b. Index prefixes can be used in sort predicates to prevent in-memory sorts.
c. We can invert the keys of an index in our sort predicate to utilize an
index by walking in backwards.
d. It's impossible to have a sorted query use a index for both sorting and
filtering.

6) MongoDB Indexes: When you can sort with indexes


Problem:
Given the following index:

{ name: 1, emails: 1 }

When the following document is inserted, how many index entries will be created?
Página 2 de 5 examen_mongodb_nf40 m1 v1
{
"name": "Beatrice McBride",
"age": 26,
"emails": [
"puovvid@wamaw.kp",
"todujufo@zoehed.mh",
"fakmir@cebfirvot.pm"
]
}

Check all answers that apply:


a. 1
b. 2
c. 3
d. 4

7) MongoDB Indexes: Partial indexes


Which of the following is true regarding partial indexes?
a. Partial indexes represent a superset of the functionality of sparse indexes.
b. Partial indexes can be used to reduce the number of keys in an index.
c. Partial indexes don't support a uniqueness constraint.
d. Partial indexes support compound indexes.

8) MongoDB Indexes: Text indexes


Which other type of index is mostly closely related to text indexes?
a. Single-key indexes.
b. Compound indexes.
c. Multi-key indexes.
d. Partial indexes.

9) MongoDB Indexes: Collations


Which of the following statements are true regarding collations on
indexes?
a. MongoDB only allows collations to be defined at collection level.
b. Collations allow the creation of case insensitive indexes.
c. Creating an index with a different collation from the base collection
implies overriding the base collection collation.
d. We can define specific collation in an index.

10) MongoDB Indexes: Wildcard index type


Using the wildcardProjection flag with Wildcard Indexes, we can:
a. Include a set of fields in the Wildcard Index.
b. Specify a set of fields in the Wildcard Index to project with $project.
c. Exclude a set of fields from the Wildcard Index.

Página 3 de 5 examen_mongodb_nf40 m1 v1
11) MongoDB Indexes: Wildcard index use cases
Which of the following are good reasons to use a Wildcard Index?
a. An application consistently queries against document field that use the
Attribute Pattern.
b. The query pattern on documents of a collection is unpredictable.
c. A collection has documents with many different fields.

12) MongoDB Indexes: Using indexes to sort

Given the following index:

{ "first_name": 1, "address.state": -1, "address.city": -1, "ssn": 1 }

Which of the following queries are able to use it for both filtering and sorting?

a.
b.

c.

d.

e.

13) MongoDB Indexes: Optimizing compound indexes

Examinate this queries:

> db.people.find({
"address.state": "Nebraska",
"last_name": /^G/,
"job": "Police officer"
})

> db.people.find({
"job": /^P/,
"first_name": /^C/,
"address.state": "Indiana"
}).sort({ "last_name": 1 })

> db.people.find({
"address.state": "Connecticut",
"birthday": {
"$gte": ISODate("2010-01-01T00:00:00.000Z"),
"$lt": ISODate("2011-01-01T00:00:00.000Z")
}
})

Página 4 de 5 examen_mongodb_nf40 m1 v1
If you had to build one index on the people collection, which of the following
indexes would best sevice all 3 queries?

a.

b.

c.

d.

e.

f.
14) Index operations: Building indexes
Which of the following are true of index build operations?
a. Foreground index builds block all reads and writes to the collection being
indexed.
b. Foreground index builds block all reads and writes to the database that
holds the collection being indexed.
c. Background index builds do not impact the query performance of the
MongoDB deployment while running.
d. Background index builds take longer to complete that foreground index
builds.
e. Background index builds block reads and writes to the collection being
indexed.

15) Index operations: Query plans


Which of the following is/are true concerning query plans?
a. MongoDB's query optimizer is statically based, where collection
heuristics are used to determine which plan wins.
b. Query plans are cached so that plans do not need to be generated and
compared against each other every time a query is executed.
c. When query plans are generated, for a given query, every index generates
at least one query plan.
d. If an index can't be used, then there is no query plan for that query.

Página 5 de 5 examen_mongodb_nf40 m1 v1

You might also like