pgvector brings vector similarity search directly into PostgreSQL, and Supabase makes it easy to use. These exercises test your understanding of vector types, distance operators, ANN indexes, and security for vector workloads.
0 / 5 completed
1 / 5
At standup, a colleague asks what the pgvector extension adds to PostgreSQL. What is the correct answer?
pgvector extends PostgreSQL with a vector(N) data type and three distance operators: <-> (L2/Euclidean), <#> (negative inner product), and <=> (cosine distance). You can store embedding vectors as columns and run approximate or exact nearest-neighbour queries using SQL. Supabase enables pgvector via create extension vector and uses it as the backbone of its vector search features.
2 / 5
During a PR review, a teammate asks what embedding dimensions matter for a pgvector column. What is the correct explanation?
The N in vector(N) must exactly match the number of dimensions in your embedding model's output. For example, OpenAI's text-embedding-3-small produces 1536-dimensional vectors, so you declare vector(1536). Inserting a vector of a different dimension raises an error, and you cannot use distance operators to compare vectors of mismatched dimensions. pgvector does not automatically resize vectors.
3 / 5
In a design review, the team discusses adding an ivfflat index to a pgvector column. What does this index do?
The IVFFlat index in pgvector is an approximate nearest-neighbour (ANN) index. It partitions all vectors into lists clusters at build time using k-means. At query time, it scans only the probes nearest clusters (configurable via SET ivfflat.probes), trading recall for speed. More probes means higher recall but slower queries. The index is effective once you have enough vectors (Supabase recommends ≥ lists × 10 rows before building).
4 / 5
An incident report shows that RLS (Row Level Security) is blocking vector similarity searches. A senior engineer asks how to correctly apply RLS to a table with vector columns. What is correct?
RLS works normally on tables with vector columns in pgvector. You create CREATE POLICY statements on the table as usual, and Postgres applies them before or alongside the similarity ordering. The nearest-neighbour search (ORDER BY embedding <=> query_vector LIMIT k) only considers rows that pass the RLS policy, so users only see results from rows they are permitted to access. No special handling is required for the vector column.
5 / 5
During a code review, a senior engineer asks what the cosine similarity operator (<=>) in pgvector returns and when to prefer it over L2 distance (<->). What is accurate?
The <=> operator computes cosine distance (= 1 − cosine_similarity), where 0 means identical direction and 2 means opposite. It is preferred for text embeddings because it measures directional similarity independent of vector magnitude — useful when embeddings for short and long texts have different norms. L2 distance (<->) is sensitive to magnitude and works better for embeddings from models that explicitly encode magnitude as meaningful.
What does the "Supabase pgvector Search Vocabulary" vocabulary exercise cover?
This exercise tests real IT vocabulary related to supabase pgvector search vocabulary through 5 multiple-choice questions, each built from realistic workplace sentences rather than abstract definitions.
Is this vocabulary exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 5 questions. Each one shows a real-world sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question, and a full results screen at the end.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Are these vocabulary exercises connected to other topics?
Yes — browse the full vocabulary exercises hub to find related modules covering adjacent IT topics and roles.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more vocabulary exercises?
Browse the full Vocabulary exercises hub for hundreds of modules covering Agile, DevOps, security, databases, architecture, and more — organised by IT role and skill.