Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

VECTOR INDEX with M=200 returns farthest candidates on 1D monotonic vectors

Aperta
#156 1 commento 0 reazioni 2 assegnatari Vedi su GitHub

@JoeJRW ci sta già lavorando.

Dal 1/6/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug

alisql version: 8.0.44-alisql-dev

Hi,I understand that ANN indexes may sacrifice accuracy for performance. However, in the following example, setting M=200 causes the query to return vectors near the end of the dataset, which are almost the farthest possible results from the query vector.

This seems different from a typical approximation error. Is this expected behavior, or does it indicate a bug in the vector index implementation?

DROP TABLE IF EXISTS tab_vidx_m3_1d_060;
DROP TABLE IF EXISTS tab_vidx_m6_1d_060;
DROP TABLE IF EXISTS tab_vidx_m200_1d_060;
DROP PROCEDURE IF EXISTS proc_insert_m_1d_060;

CREATE TABLE tab_vidx_m3_1d_060 (
  id INT PRIMARY KEY,
  v VECTOR(1),
  VECTOR INDEX vi(v) DISTANCE=EUCLIDEAN M=3
);

CREATE TABLE tab_vidx_m6_1d_060 (
  id INT PRIMARY KEY,
  v VECTOR(1),
  VECTOR INDEX vi(v) DISTANCE=EUCLIDEAN M=6
);

CREATE TABLE tab_vidx_m200_1d_060 (
  id INT PRIMARY KEY,
  v VECTOR(1),
  VECTOR INDEX vi(v) DISTANCE=EUCLIDEAN M=200
);

DELIMITER //
CREATE PROCEDURE proc_insert_m_1d_060()
BEGIN
  DECLARE i INT DEFAULT 1;
  WHILE i <= 10000 DO
    INSERT INTO tab_vidx_m3_1d_060 VALUES
      (i, VEC_FromText(CONCAT('[', i, ']')));
    INSERT INTO tab_vidx_m6_1d_060 VALUES
      (i, VEC_FromText(CONCAT('[', i, ']')));
    INSERT INTO tab_vidx_m200_1d_060 VALUES
      (i, VEC_FromText(CONCAT('[', i, ']')));
    SET i = i + 1;
  END WHILE;
END //
DELIMITER ;

CALL proc_insert_m_1d_060();
DROP PROCEDURE IF EXISTS proc_insert_m_1d_060;

SELECT id
FROM tab_vidx_m3_1d_060 FORCE INDEX(vi)
ORDER BY VEC_DISTANCE(v, VEC_FromText('[1]'))
LIMIT 10;

SELECT id
FROM tab_vidx_m6_1d_060 FORCE INDEX(vi)
ORDER BY VEC_DISTANCE(v, VEC_FromText('[1]'))
LIMIT 10;

SELECT id
FROM tab_vidx_m200_1d_060 FORCE INDEX(vi)
ORDER BY VEC_DISTANCE(v, VEC_FromText('[1]'))
LIMIT 10;
Lingua principale
C++
Stelle
6k
Fork
902
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

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 alibaba/AliSQL

Tutte le issue di alibaba/AliSQL

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.