REFRESH fails after adding a vector index to a materialized view

Aperta
#176,178 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, sql
Ambito
databases

Direzione di ricerca

Start by tracing the REFRESH MATERIALIZED VIEW path for a materialized view with a vector index, using the reproduction SQL and the error “unable to determine vector index partition” to locate the failing code and relevant tests. Confirm the failure, then identify how the refresh inserts rows when the view has a vector index. Done means refresh succeeds, the view contains IDs 1, 2, and 3, and the vector index remains usable.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

C-bug O-community T-sql-foundations X-blathers-triaged X-move-internal

Describe the problem

After a vector index is created on a materialized view, any data refresh fails
with an internal error:

ERROR: internal error: insert row: unable to determine vector index partition

The materialized view remains at its previous contents and continues returning
stale data.

To Reproduce

DROP MATERIALIZED VIEW IF EXISTS vector_refresh_mv CASCADE;
DROP TABLE IF EXISTS vector_refresh_base CASCADE;

CREATE TABLE vector_refresh_base (
    id INT PRIMARY KEY,
    vec VECTOR(2)
);

INSERT INTO vector_refresh_base VALUES
    (1, '[1,1]'),
    (2, '[5,5]');

CREATE MATERIALIZED VIEW vector_refresh_mv AS
SELECT id, vec FROM vector_refresh_base;

CREATE VECTOR INDEX vector_refresh_mv_idx
ON vector_refresh_mv (vec);

SELECT id
FROM vector_refresh_mv
ORDER BY vec <-> '[5,5]'
LIMIT 1;
-- 2

INSERT INTO vector_refresh_base VALUES (3, '[9,9]');

REFRESH MATERIALIZED VIEW vector_refresh_mv;
-- ERROR: internal error: insert row: unable to determine vector index partition

SELECT id FROM vector_refresh_mv ORDER BY id;
-- 1
-- 2

Expected behavior

The refresh should succeed and update the materialized view to contain all
three base-table rows, including ID 3. The final query should return 1,
2, and 3, and the vector index should remain usable after refresh.

Environment:

  • CockroachDB version: v26.3.0-alpha.00000000-dev-13cb3eb27674b4a981e5c526d04c2387e81efd0b
  • Server OS: Linux amd64
  • Client app: psql 16.15

Jira issue: CRDB-70506

Lingua principale
Go
Stelle
32.6k
Fork
4.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cockroachdb/cockroach

Tutte le issue di cockroachdb/cockroach

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.