In Cloud Datastore, Movie entities have multi-valued properties 'actors' and 'tags' and a single-valued 'date_released'. Queries filter by actor or tag ordered by date_released. How do you avoid a combinatorial explosion of indexes?
Choose an answer
Tap an option to check your answer.
Correct answer: Declare only the necessary composite indexes (e.g., actor + date_released and tag + date_released) explicitly in index configuration..
Why this is the answer
The correct approach is to declare only the necessary composite indexes. Cloud Datastore automatically creates single-property indexes. For queries involving multi-valued properties with an ORDER BY clause on another property, composite indexes are required. By explicitly defining (actor, datereleased) and (tag, datereleased) indexes, you support the specified query patterns efficiently. Manually declaring all multi-valued property combinations leads to a combinatorial explosion, creating many unnecessary indexes that consume storage and increase write latency. Excluding multi-valued properties from indexing (excludefromindexes = 'actors, tags') would prevent filtering or ordering on those fields, making the desired queries impossible. Excluding datepublished would prevent ordering by that field.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed