Free tool

Index planner & SQL generator

Describe the vectors you are storing and this tool generates the correct CREATE INDEX statement, the matching distance operator and operator class, a storage estimate, recommended query tuning values, and warnings when your dimensions exceed the index limits. Everything runs in your browser — nothing you type is sent anywhere.

Your vectors

Only metrics supported by the selected type are enabled.

Index type

If your queries add a WHERE clause, enter the filtered column to get iterative-scan advice.

Names are used only to build the example SQL. The output is a starting point — tune with real data and measure recall.

Recommendations

Distance operator
—
Operator class
—
Index
—
Query tuning
—
Vector storage (est.)
—

Generated SQL

SQL postgres

What this plan means

Adjust the inputs on the left to generate a plan.

Transparency

How the recommendations are derived

The tool applies documented pgvector rules and defaults; it does not guess. The exact figures come from the project's own guidance.

Index parameters

  • IVFFlat lists: start with rows / 1000 for up to 1 million rows, and sqrt(rows) above that.
  • IVFFlat probes: start at sqrt(lists) and increase for recall.
  • HNSW defaults: m = 16 and ef_construction = 64.
  • HNSW query default: hnsw.ef_search = 40; raise it for better recall at the cost of speed.
  • Iterative scans: enable hnsw.iterative_scan or ivfflat.iterative_scan when a query filters results.

Storage estimate

Per-row bytes, multiplied by the row count. The index and TOAST overhead are excluded.

TypeBytes per row
vector4 * dimensions + 8
halfvec2 * dimensions + 8
bitdimensions / 8 + 8
sparsevec8 * non-zero elements + 16
The index-specific dimension limits are 2,000 for vector, 4,000 for halfvec, 64,000 for bit, and 1,000 non-zero elements for sparsevec. When you exceed a limit the tool suggests half-precision indexing, binary quantization, subvector indexing, or dimensionality reduction. See indexing for details.
Checklist

After you run it

  1. Enable the extension once per database (see the install guide): CREATE EXTENSION vector;.
  2. Load your data first. Use COPY for bulk loads, then add indexes — especially IVFFlat, which needs data to train.
  3. Create the index. In production, use CREATE INDEX CONCURRENTLY to avoid blocking writes, and raise maintenance_work_mem so an HNSW graph fits in memory.
  4. Tune the query. Set hnsw.ef_search or ivfflat.probes per query with SET LOCAL inside a transaction when you need different recall.
  5. Verify the plan. Run EXPLAIN (ANALYZE, BUFFERS) and confirm the index is used, not a sequential scan.
  6. Measure recall. Compare approximate results with exact results by disabling index scans for one query, and raise ef_search or probes if recall is too low.
If your new index isn’t being used, or a query returns fewer rows than expected, see the troubleshooting guide.
FAQ

About this tool

Is my data uploaded anywhere?

No. The index planner runs entirely in your browser using JavaScript, and nothing you type is transmitted to a server. You do not need an account. The site uses Google Analytics to measure aggregate traffic, but it never receives the values you enter here — see the privacy statement.

How are the IVFFlat list and probe values chosen?

The tool uses pgvector's own guidance: start with rows / 1000 lists for up to 1 million rows and sqrt(rows) above that, then start probing at sqrt(lists). Increase probes for better recall at the cost of speed.

Why does it warn that my dimensions are too high?

Approximate indexes have dimension limits: 2,000 for vector, 4,000 for halfvec, 64,000 for bit, and 1,000 non-zero elements for sparsevec. The tool suggests half-precision indexing, binary quantization, subvector indexing, or dimensionality reduction when you exceed them.

Does the tool cover every pgvector feature?

No. It focuses on choosing an index, generating the CREATE INDEX statement, and picking tuning values. For data types, operators, functions, filtering, and hybrid search, see the documentation and the cheatsheet.