1Z0-184-25 Question 32
Single answerYour data science team wants to store product embeddings for vector search in an existing table named PRODUCT_DATA on Oracle Cloud Infrastructure (OCI). They have requested a new 512-dimensional vector column (ITEM_EMBEDDINGS), along with an index for approximate nearest neighbor queries, and need to add both without significant downtime. What is the recommended approach to fulfill these requirements?
- A
Create a new table with the ITEM_EMBEDDINGS column, copy existing rows from PRODUCT_DATA over, and then rename the new table to maintain minimal downtime.
- B
Use an ALTER TABLE statement to add the ITEM_EMBEDDINGS VECTOR(512) column, followed by a CREATE INDEX statement with a vector index for approximate nearest neighbor queries.
- C
Store the vector data in a single JSON column and rely on a CTXCAT text index to speed up vector-based queries.
- D
Export all data from PRODUCT_DATA, drop the table, recreate it with the new ITEM_EMBEDDINGS column, and re-import the data once the index creation is complete.
Show answer and explanation
Correct answer: B
Explanation
The best practice for adding a vector column to support advanced search use cases is to modify the existing table using ALTER TABLE and then create the appropriate vector index. This approach aligns with Oracle Database� recommended procedures for evolving schemas in production environments with minimal downtime. Refer to the Oracle Database 23c documentation on vector-based data types and indexes for additional details on syntax and best practices.
- A. Incorrect.
Option 1 is incorrect because creating an entirely new table and migrating data can introduce more complexity, extended downtime, and potential risk if the cutover is not seamless.
- B. Correct.
Option 2 is correct. The recommended approach is to use an ALTER TABLE statement to add a vector column (e.g., ITEM_EMBEDDINGS VECTOR(512)) to the existing table. Once added, you can create a vector index (often referred to as an approximate nearest neighbor index) to optimize searches. This method typically results in minimal downtime and follows best practices for incremental schema evolution.
- C. Incorrect.
Option 3 is incorrect because a CTXCAT text index is designed for text-based metadata searching, not vector-based approximate nearest neighbor queries. Storing embeddings in JSON can work in some scenarios, but it does not provide the specialized indexing needed for efficient vector searches.
- D. Incorrect.
Option 4 is incorrect because dropping and recreating the table would cause significant downtime and unnecessary complexity. While it achieves the goal in theory, it is not a practical approach in production for minimal service interruption.