Topic 1 Question 44
You are deploying a new storage system for your mobile application, which is a media streaming service. You decide the best fit is Google Cloud Datastore. You have entities with multiple properties, some of which can take on multiple values. For example, in the entity 'Movie' the property 'actors' and the property 'tags' have multiple values but the property 'date released' does not. A typical query would ask for all movies with actor=<actorname> ordered by date_released or all movies with tag=Comedy ordered by date_released. How should you avoid a combinatorial explosion in the number of indexes?
Manually configure the index in your index config as follows:

Manually configure the index in your index config as follows:

Set the following in your entity options: exclude_from_indexes = 'actors, tags'
Set the following in your entity options: exclude_from_indexes = 'date_published'
ユーザの投票
コメント(8)
- 正解だと思う選択肢: A
Correct answer is A Read in reference : https://cloud.google.com/datastore/docs/concepts/indexes#index_limits n this case, you can circumvent the exploding index by manually configuring an index in your index configuration file: indexes:
- kind: Task
properties:
- name: tags
- name: created
- kind: Task
properties:
- name: collaborators
- name: created This reduces the number of entries needed to only (|tags| * |created| + |collaborators| * |created|), or 6 entries instead of 9
👍 5Wasss1232022/09/13 - kind: Task
properties:
- 正解だと思う選択肢: A
Option B & D reject because mention date_publised in question date_released is column Option C also not correct, I would go with option A.
👍 3DGames2022/12/13 - 正解だと思う選択肢: D
Correct Answer D:
This is the way the DB is typically queried:
- movies with actor=<actorname> ordered by date_released
- movies with tag=Comedy ordered by date_released
so it seems that we need indices in actor,tag and date_released for sorting.
❌ A: this would be the correct answer, however, the format is incorrect, the correct format would be '- name: date_released' correctly indented.
❌ B: This seems to be unnecessary, since typically actor and tag are not queried together. also, there is a clear indentation issue
❌ C: We don't want to ignore actor and tag, we need those indices.
✅ D: If we leave datastore to automatically create the indices and if we specify that the 'date_released' property needs to be excluded from indices, then we would have less indices (but maybe slower queries when ordering them, but hey, how many 'comedies' there could be in the world)
👍 2Ender_H2022/09/28
シャッフルモード