An application performs similarity search across 5 million embeddings stored in Azure Database for PostgreSQL with pgvector. Queries often filter by department before ranking by cosine distance.P95 latency for vector similarity queries exceeds the SLA target. Monitoring shows sustained high CPU use during query execution.You need to reduce P95 latency for filtered vector similarity queries.What should you do?
Answer(s): A
Creating a B-tree index on the department column will help, but only if you use the correct indexing strategy, as a standard B-tree index alone is often ignored during vector searches.When you run a query that filters by metadata before performing a vector similarity search, PostgreSQL must choose between filtering the rows first or searching the vector index first. In many cases, a standard B-tree index on the metadata column combined with an HNSW/IVFFlat index on the vector column results in pre-filtering that defaults to a sequential scan, or post-filtering that returns fewer results than requested.
https://learn.microsoft.com/en-us/azure/horizondb/ai/vector-search-pgvector
You store embeddings in a property named embedding in an Azure Cosmos DB for NoSQL container.You must retrieve the five most similar documents to an input embedding.You need to construct the similarity query.What should you do?
Answer(s): D
To retrieve the five most similar documents from Azure Cosmos DB for NoSQL using vector search, you must limit the number of results.When performing vector similarity searches using the VectorDistance() function, you must restrict the output size directly in the query.
https://stemhash.com/semantic-search-with-llms/
You are developing a Java application to be deployed in Azure. The application stores sensitive data in Azure Cosmos DB.You need to configure Always Encrypted to encrypt the sensitive data inside the application.What should you do first?
To configure Always Encrypted (client-side encryption) for your Java application using Azure Cosmos DB, you must first create a customer-managed key (CMK) and store it in a new Azure Key Vault instance
https://lennilobel.wordpress.com/2022/08/20/configuring-client-side-encryption-aka-always-encrypted-in-azure-cosmos-db/
You are developing an AI search API that caches semantic search results in Redis.Search results must remain cached for 10 minutes. If the underlying data changes, cached entries must NOT be returned.You need to implement a cache-aside strategy to ensure data consistency.Which two actions should you perform? Each correct answer presents part of the solution.Note: Each correct selection is worth one point.
Answer(s): B,D
Delete keys on mutation. Implement an event-driven or database-hook system to purge related Redis keys the moment the source data updates.Use absolute expiration. Set a strict, un-extendable Time-To-Live (TTL) of 10 minutes when writing to the cache, ensuring the data naturally expires even if a deletion event is missed.Incorrect: [Not C] Implementing a sliding expiration is not a good step for this specific architecture because it violates the requirement that entries must not be returned if the underlying data changes.
https://medium.com/real-world-net/net-caching-strategies-compared-redis-vs-memory-vs-hybrid-b8b8be1e708d
You store embeddings in Redis by using keys formatted as doc:(id). Some embeddings are accessed frequently. Others are rarely used.You need to implement a caching strategy that keeps only frequently accessed embeddings in memory.What should you use?
Answer(s): B
To implement this strategy, you should use allkeys-lru combined with the EXPIRE command as a secondary fallback.Primary Mechanism: Configure your Redis maxmemory-policy to allkeys-lru.Secondary Mechanism: Apply the EXPIRE command to your keys as a safety net.Why allkeys-lru is the Best Choice Memory Management: It automatically evicts the Least Recently Used (LRU) keys across your entire dataset when Redis hits its memory limit.Frequent Access: It guarantees that frequently accessed embeddings stay in memory, regardless of when they were created.Prefix Independent: It scans all keys, making it perfect for your doc:(id) format
https://rahulchowdhury.in/blog/redis-caching-patterns-every-mern-dev
Post your Comments and Discuss Microsoft AI-200 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the AI-200 content, but please register or login to continue.