Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Oracle · Agentic AI for Oracle AI Database Professional

IVF Indexes and Choosing an Index

Agentic AI for Oracle AI Database Professional · Lesson 7 of 20 · 48:17

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Agentic AI for Oracle AI Database Professional exam (1Z0-1159-26). In this lesson: IVF partitions and centroids, creating and probing an IVF index, local indexes on partitioned tables, accuracy after many changes, and choosing between HNSW and IVF. Follows Ambergate Appliances, a fictional appliance maker. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Too big for memory

Ambergate keeps ten years of service logs, partitioned by month, and their vectors now number in the billions. An HNSW graph of that size would never fit in memory, yet technicians still need fast searches. This lesson covers IVF indexes, how they are created and searched, how they age, and how to choose between IVF and HNSW.

IVF

IVF stands for Inverted File Flat, and it belongs to the neighbor partition family. When the index is built, a k-means clustering finds a set of centroids, the centers of groups of similar vectors. Each vector is then stored in the partition of its closest centroid. The index is kept in tables on disk, with help from the vector pool, so it does not need to fit in memory.

Create and probe

You create it with create vector index and the organization neighbor partitions clause, along with a distance and a target accuracy. The optional neighbor partitions parameter sets the number of partitions, and by default it is close to the square root of the number of rows. At query time, the search compares the query vector with the centroids, and probes only the closest partitions. More probes mean better accuracy but a slower search, and the neighbor partition probes setting controls it for a query.

Aging and partitions

On a partitioned table, an IVF index can be global, which is the default, or local, with one index partition for each table partition. Building an IVF index needs a large temporary tablespace, since the clustering works on all the vectors. After many inserts and updates, the centroids no longer describe the data well, so accuracy slowly drops. You can measure it, and rebuild the index with the REBUILD_INDEX procedure, to compute new centroids.

HNSW or IVF

So which index should you choose? HNSW stays in memory, and it gives the fastest and most accurate searches, as long as the graph fits in the vector pool. IVF stays on disk, balances good accuracy with reasonable speed, and scales to very large volumes. IVF also offers local indexes on partitioned tables, and both families support searches over several vectors per document. And after heavy changes, HNSW refreshes through its journals and snapshots, while IVF needs a rebuild to restore its centroids.

Recap

Let's recap. IVF groups vectors around centroids found with k-means, and it lives on disk, with help from the vector pool. It is created with organization neighbor partitions, and each search probes the partitions closest to the query. More probes raise accuracy and slow the search, and they can be set for a query. IVF can be local on a partitioned table, and after heavy changes, a rebuild computes new centroids. Choose HNSW for speed and accuracy when the graph fits in memory, and IVF for very large volumes.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. With its new IVF index, Ambergate’s log search sometimes misses relevant cases that an exact search finds. Without rebuilding the index, what can a query raise to find more of them?

    • The NEIGHBORS value of the vector index
    • The number of partitions probed
    • The temporary tablespace of the database
    • The NEIGHBOR PARTITIONS count of the index
    Show the answer

    The number of partitions probed

    Probing more partitions compares the query with more vectors, so accuracy goes up, and the search slows down a little. “The NEIGHBORS value of the vector index” is an HNSW parameter, and it would not apply to this index. “The temporary tablespace of the database” only matters while an index is being built. And “The NEIGHBOR PARTITIONS count of the index” is also set when the index is built, and changing it means a rebuild.

  2. A year after its IVF index was built, after millions of new service logs, Ambergate measures a clear drop in its search accuracy. What should the team do?

    • Raise VECTOR_MEMORY_SIZE on the container
    • Switch every query to FETCH EXACT FIRST
    • Rebuild the index for new centroids
    • Add INCLUDE columns to the IVF index
    Show the answer

    Rebuild the index for new centroids

    The centroids were computed on the old data, and a rebuild computes new ones that fit the current vectors. “Raise VECTOR_MEMORY_SIZE on the container” helps an HNSW index, which lives in memory, but it does not fix old centroids. “Switch every query to FETCH EXACT FIRST” gives up the index entirely, and every search becomes slow. And “Add INCLUDE columns to the IVF index” lets a filter skip the table, but it does not change the partitions.

  3. Ambergate’s service logs hold billions of vectors in a table partitioned by month, and the server’s memory cannot hold a graph of them. Which index fits best?

    • A local IVF index on the partitions
    • An HNSW index with more NEIGHBORS
    • No index, with an exact search every time
    • An HNSW index with a higher EFSEARCH
    Show the answer

    A local IVF index on the partitions

    An IVF index stays on disk, scales to billions of vectors, and can be local to the monthly partitions. “An HNSW index with more NEIGHBORS” still needs the whole graph in memory, and more neighbors would make it bigger. “No index, with an exact search every time” works, but every search would compare billions of vectors. And “An HNSW index with a higher EFSEARCH” only widens each HNSW search, and the graph still would not fit.