Cold Start Optimization
The VectorChord index is loaded from the disk during the first query. This is why the cold start is much slower.
If the capacity of the buffer pool (shared_buffers) is sufficient, the index can be cached in memory, which speeds up subsequent queries.
In VectorChord, we have indexing prewarm to improve cold start performance. Let's dive in!
Indexing Prewarm
The vchordrq_prewarm
function is a VectorChord SQL function that preloads index pages into memory to improve query performance by warming up the cache for VectorChord indexes.
You call vchordrq_prewarm by passing the index name:
SQL
-- vchordrq_prewarm(index_name) to prewarm the index into the shared buffer
SELECT vchordrq_prewarm('gist_train_embedding_idx')
INFO
The runtime of vchordrq_prewarm
is correlated to the number of rows, and can consume several minutes for large table (>