Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres isn't always using hnsw index - Update cost estimate? #113

Open
yoloVoe opened this issue Sep 4, 2023 · 1 comment
Open

Postgres isn't always using hnsw index - Update cost estimate? #113

yoloVoe opened this issue Sep 4, 2023 · 1 comment

Comments

@yoloVoe
Copy link
Contributor

yoloVoe commented Sep 4, 2023

Postgres is sometimes not using hnsw index, and returning the wrong values. Fix this.

Query:

CREATE TABLE sift_base10k_1 (
     id SERIAL PRIMARY KEY,
     v real[128]
);
\copy sift_base10k_1 (v) FROM '/tmp/lanterndb/vector_datasets/siftsmall_base_arrays_smaller.csv' with csv;
CREATE INDEX hnsw_idx ON sift_base10k_1 USING hnsw (v dist_l2sq_ops) WITH (M=5, ef_construction=10, ef=100, dims=128);

-- \copy sift_base10k_1 (v) FROM '/tmp/lanterndb/vector_datasets/siftsmall_base_arrays_smaller.csv' with csv;
-- SELECT V AS v4444  FROM sift_base10k_1 WHERE id = 4444 \gset
EXPLAIN ANALYZE SELECT * FROM sift_base10k_1 order by v <-> '{120,15,0,0,0,8,8,10,34,0,0,0,1,120,89,25,16,0,0,1,3,39,120,120,26,0,0,11,70,7,19,26,111,16,0,0,0,105,49,16,3,0,0,0,1,120,83,8,120,2,0,0,0,20,55,98,120,1,4,10,55,39,13,46,16,0,0,0,8,87,31,8,8,0,0,0,0,36,34,14,120,89,6,6,11,7,12,31,64,24,4,6,26,54,117,25,0,0,0,2,16,7,1,0,11,0,0,2,2,0,0,2,120,26,2,4,25,28,19,69,3,6,1,4,57,52,24,12}'
LIMIT 5;
-- should be 5100
SELECT id, l2sq_dist(v, '{120,15,0,0,0,8,8,10,34,0,0,0,1,120,89,25,16,0,0,1,3,39,120,120,26,0,0,11,70,7,19,26,111,16,0,0,0,105,49,16,3,0,0,0,1,120,83,8,120,2,0,0,0,20,55,98,120,1,4,10,55,39,13,46,16,0,0,0,8,87,31,8,8,0,0,0,0,36,34,14,120,89,6,6,11,7,12,31,64,24,4,6,26,54,117,25,0,0,0,2,16,7,1,0,11,0,0,2,2,0,0,2,120,26,2,4,25,28,19,69,3,6,1,4,57,52,24,12}'), v FROM sift_base10k_1 order by v <-> '{120,15,0,0,0,8,8,10,34,0,0,0,1,120,89,25,16,0,0,1,3,39,120,120,26,0,0,11,70,7,19,26,111,16,0,0,0,105,49,16,3,0,0,0,1,120,83,8,120,2,0,0,0,20,55,98,120,1,4,10,55,39,13,46,16,0,0,0,8,87,31,8,8,0,0,0,0,36,34,14,120,89,6,6,11,7,12,31,64,24,4,6,26,54,117,25,0,0,0,2,16,7,1,0,11,0,0,2,2,0,0,2,120,26,2,4,25,28,19,69,3,6,1,4,57,52,24,12}'
LIMIT 5;

Data:

"{0.0, 16.0, 35.0, 5.0, 32.0, 31.0, 14.0, 10.0, 11.0, 78.0, 55.0, 10.0, 45.0, 83.0, 11.0, 6.0, 14.0, 57.0, 102.0, 75.0, 20.0, 8.0, 3.0, 5.0, 67.0, 17.0, 19.0, 26.0, 5.0, 0.0, 1.0, 22.0, 60.0, 26.0, 7.0, 1.0, 18.0, 22.0, 84.0, 53.0, 85.0, 119.0, 119.0, 4.0, 24.0, 18.0, 7.0, 7.0, 1.0, 81.0, 106.0, 102.0, 72.0, 30.0, 6.0, 0.0, 9.0, 1.0, 9.0, 119.0, 72.0, 1.0, 4.0, 33.0, 119.0, 29.0, 6.0, 1.0, 0.0, 1.0, 14.0, 52.0, 119.0, 30.0, 3.0, 0.0, 0.0, 55.0, 92.0, 111.0, 2.0, 5.0, 4.0, 9.0, 22.0, 89.0, 96.0, 14.0, 1.0, 0.0, 1.0, 82.0, 59.0, 16.0, 20.0, 5.0, 25.0, 14.0, 11.0, 4.0, 0.0, 0.0, 1.0, 26.0, 47.0, 23.0, 4.0, 0.0, 0.0, 4.0, 38.0, 83.0, 30.0, 14.0, 9.0, 4.0, 9.0, 17.0, 23.0, 41.0, 0.0, 0.0, 2.0, 8.0, 19.0, 25.0, 23.0, 1.0}"
"{120.0, 15.0, 6.0, 1.0, 0.0, 0.0, 0.0, 12.0, 80.0, 18.0, 65.0, 123.0, 0.0, 0.0, 0.0, 2.0, 1.0, 2.0, 123.0, 123.0, 2.0, 0.0, 0.0, 0.0, 7.0, 10.0, 58.0, 39.0, 3.0, 0.0, 0.0, 0.0, 123.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 40.0, 123.0, 23.0, 6.0, 15.0, 1.0, 3.0, 4.0, 32.0, 10.0, 8.0, 24.0, 115.0, 90.0, 48.0, 7.0, 1.0, 7.0, 10.0, 7.0, 60.0, 54.0, 23.0, 8.0, 1.0, 119.0, 8.0, 1.0, 0.0, 0.0, 0.0, 0.0, 53.0, 100.0, 3.0, 0.0, 0.0, 0.0, 47.0, 121.0, 123.0, 2.0, 1.0, 0.0, 0.0, 30.0, 123.0, 123.0, 5.0, 32.0, 18.0, 0.0, 1.0, 10.0, 62.0, 63.0, 19.0, 31.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 25.0, 16.0, 0.0, 0.0, 5.0, 29.0, 41.0, 55.0, 31.0, 24.0, 16.0, 11.0, 5.0, 7.0, 44.0, 48.0, 9.0, 52.0, 34.0, 16.0, 5.0, 0.0, 5.0, 3.0, 2.0}"
"{19.0, 14.0, 10.0, 13.0, 7.0, 0.0, 2.0, 4.0, 15.0, 43.0, 139.0, 48.0, 6.0, 0.0, 0.0, 1.0, 4.0, 93.0, 139.0, 22.0, 0.0, 0.0, 0.0, 2.0, 0.0, 61.0, 87.0, 1.0, 0.0, 0.0, 0.0, 0.0, 88.0, 14.0, 1.0, 2.0, 2.0, 1.0, 3.0, 27.0, 139.0, 94.0, 106.0, 14.0, 0.0, 0.0, 2.0, 24.0, 13.0, 28.0, 139.0, 56.0, 1.0, 0.0, 4.0, 3.0, 5.0, 51.0, 139.0, 14.0, 3.0, 1.0, 0.0, 0.0, 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, 5.0, 7.0, 8.0, 3.0, 4.0, 36.0, 36.0, 89.0, 31.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5.0, 37.0, 20.0, 0.0, 0.0, 0.0, 33.0, 2.0, 0.0, 0.0, 1.0, 50.0, 87.0, 52.0, 136.0, 64.0, 1.0, 5.0, 2.0, 12.0, 46.0, 44.0, 35.0, 28.0, 3.0, 118.0, 88.0, 1.0, 0.0, 2.0, 0.0, 0.0, 23.0, 82.0, 45.0, 0.0, 0.0, 0.0, 96.0, 1.0, 0.0, 0.0, 10.0, 123.0, 21.0, 24.0, 136.0, 12.0, 0.0, 0.0, 0.0, 4.0, 41.0, 117.0, 19.0, 1.0, 0.0, 17.0, 37.0, 93.0, 116.0, 33.0, 0.0, 0.0, 5.0, 28.0, 41.0, 47.0, 47.0, 7.0, 53.0, 0.0, 0.0, 0.0, 1.0, 22.0, 2.0, 20.0, 77.0, 0.0, 0.0, 0.0, 0.0, 8.0, 136.0, 113.0, 6.0, 0.0, 0.0, 0.0, 0.0, 75.0, 136.0, 32.0, 37.0, 0.0, 0.0, 0.0, 0.0, 10.0, 51.0, 47.0}"
"{61.0, 3.0, 0.0, 0.0, 5.0, 47.0, 9.0, 17.0, 2.0, 1.0, 6.0, 21.0, 23.0, 89.0, 77.0, 43.0, 11.0, 15.0, 63.0, 41.0, 4.0, 0.0, 15.0, 67.0, 34.0, 21.0, 8.0, 7.0, 0.0, 0.0, 0.0, 7.0, 87.0, 8.0, 0.0, 34.0, 76.0, 39.0, 4.0, 20.0, 0.0, 1.0, 5.0, 57.0, 104.0, 74.0, 58.0, 75.0, 43.0, 10.0, 13.0, 7.0, 2.0, 0.0, 52.0, 121.0, 72.0, 28.0, 13.0, 6.0, 7.0, 2.0, 4.0, 50.0, 75.0, 12.0, 1.0, 42.0, 50.0, 1.0, 5.0, 47.0, 0.0, 21.0, 84.0, 121.0, 93.0, 1.0, 2.0, 5.0, 66.0, 121.0, 121.0, 7.0, 0.0, 0.0, 1.0, 33.0, 110.0, 77.0, 9.0, 0.0, 24.0, 42.0, 1.0, 12.0, 13.0, 54.0, 34.0, 3.0, 3.0, 0.0, 0.0, 7.0, 1.0, 62.0, 121.0, 22.0, 7.0, 7.0, 9.0, 1.0, 1.0, 87.0, 114.0, 2.0, 8.0, 25.0, 27.0, 0.0, 3.0, 16.0, 8.0, 2.0, 41.0, 59.0, 6.0, 0.0}"
"{24.0, 22.0, 1.0, 0.0, 0.0, 1.0, 10.0, 39.0, 14.0, 13.0, 2.0, 0.0, 1.0, 45.0, 47.0, 27.0, 8.0, 3.0, 13.0, 30.0, 2.0, 12.0, 88.0, 86.0, 3.0, 0.0, 12.0, 89.0, 12.0, 0.0, 6.0, 17.0, 27.0, 52.0, 22.0, 6.0, 30.0, 62.0, 17.0, 6.0, 9.0, 11.0, 2.0, 2.0, 13.0, 120.0, 79.0, 7.0, 120.0, 10.0, 0.0, 0.0, 0.0, 40.0, 82.0, 120.0, 120.0, 5.0, 13.0, 27.0, 17.0, 0.0, 3.0, 51.0, 0.0, 2.0, 17.0, 92.0, 108.0, 29.0, 14.0, 3.0, 4.0, 37.0, 120.0, 71.0, 36.0, 46.0, 6.0, 0.0, 120.0, 100.0, 107.0, 3.0, 1.0, 0.0, 0.0, 7.0, 120.0, 19.0, 3.0, 6.0, 29.0, 2.0, 2.0, 16.0, 0.0, 0.0, 6.0, 17.0, 8.0, 6.0, 86.0, 20.0, 0.0, 21.0, 87.0, 18.0, 1.0, 6.0, 98.0, 34.0, 19.0, 18.0, 56.0, 8.0, 4.0, 17.0, 53.0, 24.0, 84.0, 10.0, 2.0, 4.0, 3.0, 0.0, 1.0, 18.0}"
"{8.0, 2.0, 1.0, 6.0, 30.0, 14.0, 25.0, 39.0, 13.0, 1.0, 1.0, 5.0, 46.0, 45.0, 46.0, 71.0, 1.0, 0.0, 0.0, 0.0, 53.0, 51.0, 2.0, 3.0, 69.0, 4.0, 0.0, 0.0, 17.0, 11.0, 0.0, 12.0, 28.0, 53.0, 28.0, 56.0, 34.0, 5.0, 1.0, 7.0, 25.0, 10.0, 8.0, 126.0, 77.0, 7.0, 4.0, 72.0, 4.0, 6.0, 10.0, 4.0, 45.0, 38.0, 5.0, 26.0, 102.0, 80.0, 14.0, 4.0, 9.0, 2.0, 0.0, 6.0, 110.0, 64.0, 14.0, 37.0, 4.0, 0.0, 0.0, 14.0, 41.0, 28.0, 25.0, 126.0, 126.0, 0.0, 2.0, 16.0, 1.0, 126.0, 114.0, 29.0, 19.0, 5.0, 3.0, 12.0, 30.0, 126.0, 125.0, 7.0, 11.0, 2.0, 0.0, 0.0, 100.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 56.0, 51.0, 16.0, 23.0, 84.0, 94.0, 11.0, 2.0, 31.0, 38.0, 126.0, 49.0, 23.0, 16.0, 1.0, 0.0, 6.0, 5.0, 41.0, 45.0, 12.0, 9.0, 1.0, 0.0, 1.0}"
"{33.0, 20.0, 2.0, 0.0, 0.0, 37.0, 75.0, 28.0, 1.0, 0.0, 0.0, 0.0, 7.0, 96.0, 134.0, 21.0, 92.0, 29.0, 1.0, 3.0, 22.0, 61.0, 74.0, 31.0, 26.0, 19.0, 1.0, 15.0, 89.0, 16.0, 0.0, 0.0, 3.0, 4.0, 0.0, 1.0, 19.0, 134.0, 80.0, 13.0, 9.0, 11.0, 6.0, 7.0, 4.0, 62.0, 134.0, 21.0, 134.0, 7.0, 2.0, 5.0, 17.0, 32.0, 65.0, 120.0, 50.0, 3.0, 0.0, 6.0, 123.0, 89.0, 7.0, 20.0, 16.0, 37.0, 0.0, 0.0, 40.0, 46.0, 4.0, 4.0, 15.0, 66.0, 8.0, 22.0, 32.0, 0.0, 2.0, 2.0, 134.0, 23.0, 2.0, 16.0, 49.0, 24.0, 36.0, 77.0, 37.0, 0.0, 0.0, 0.0, 22.0, 88.0, 67.0, 29.0, 10.0, 60.0, 6.0, 1.0, 5.0, 1.0, 0.0, 0.0, 4.0, 72.0, 38.0, 33.0, 22.0, 0.0, 0.0, 0.0, 38.0, 83.0, 22.0, 35.0, 46.0, 15.0, 4.0, 2.0, 19.0, 10.0, 8.0, 9.0, 12.0, 14.0, 11.0, 8.0}"
"{107.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 12.0, 49.0, 8.0, 20.0, 51.0, 126.0, 26.0, 0.0, 5.0, 0.0, 45.0, 126.0, 47.0, 76.0, 20.0, 2.0, 0.0, 1.0, 42.0, 118.0, 17.0, 0.0, 0.0, 0.0, 0.0, 126.0, 28.0, 0.0, 0.0, 0.0, 0.0, 0.0, 17.0, 117.0, 55.0, 96.0, 44.0, 20.0, 0.0, 0.0, 4.0, 0.0, 59.0, 126.0, 50.0, 33.0, 8.0, 0.0, 0.0, 0.0, 9.0, 89.0, 71.0, 33.0, 16.0, 0.0, 0.0, 126.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 26.0, 126.0, 14.0, 3.0, 0.0, 2.0, 3.0, 1.0, 44.0, 5.0, 3.0, 4.0, 5.0, 71.0, 89.0, 1.0, 4.0, 0.0, 0.0, 0.0, 3.0, 41.0, 72.0, 13.0, 1.0, 70.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 53.0, 106.0, 0.0, 0.0, 0.0, 1.0, 6.0, 4.0, 104.0, 7.0, 0.0, 0.0, 9.0, 64.0, 78.0, 11.0, 9.0, 0.0, 0.0, 0.0, 1.0, 34.0, 67.0, 16.0, 0.0}"
"{14.0, 14.0, 0.0, 3.0, 8.0, 3.0, 4.0, 2.0, 19.0, 36.0, 39.0, 41.0, 13.0, 0.0, 0.0, 2.0, 11.0, 6.0, 76.0, 107.0, 10.0, 0.0, 0.0, 1.0, 118.0, 18.0, 4.0, 17.0, 0.0, 0.0, 0.0, 5.0, 102.0, 23.0, 0.0, 0.0, 1.0, 4.0, 21.0, 38.0, 105.0, 118.0, 76.0, 2.0, 0.0, 3.0, 3.0, 9.0, 5.0, 53.0, 90.0, 118.0, 61.0, 52.0, 12.0, 0.0, 118.0, 20.0, 4.0, 77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 0.0, 0.0, 0.0, 0.0, 1.0, 24.0, 61.0, 66.0, 1.0, 21.0, 7.0, 0.0, 1.0, 48.0, 74.0, 29.0, 8.0, 45.0, 58.0, 3.0, 0.0, 0.0, 3.0, 3.0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 80.0, 137.0, 9.0, 0.0, 0.0, 0.0, 0.0, 2.0, 130.0, 137.0, 7.0, 137.0, 24.0, 0.0, 0.0, 3.0, 102.0, 130.0, 48.0, 137.0, 55.0, 5.0, 1.0, 7.0, 7.0, 1.0, 14.0, 0.0, 16.0, 20.0, 5.0, 0.0, 14.0, 54.0, 3.0, 4.0, 0.0, 13.0, 32.0, 37.0, 30.0, 51.0, 3.0, 137.0, 1.0, 0.0, 3.0, 12.0, 8.0, 14.0, 98.0, 137.0, 0.0, 0.0, 0.0, 12.0, 35.0, 18.0, 95.0, 1.0, 14.0, 13.0, 4.0, 3.0, 0.0, 0.0, 0.0, 1.0, 4.0, 9.0, 28.0, 65.0, 9.0, 0.0, 0.0, 96.0, 54.0, 0.0, 4.0, 24.0, 3.0, 5.0, 45.0, 68.0, 16.0, 0.0, 0.0, 3.0, 64.0, 34.0, 47.0}"
"{0.0, 0.0, 0.0, 0.0, 0.0, 93.0, 60.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 92.0, 136.0, 14.0, 42.0, 0.0, 0.0, 0.0, 1.0, 38.0, 127.0, 63.0, 27.0, 0.0, 0.0, 2.0, 1.0, 1.0, 5.0, 34.0, 3.0, 13.0, 11.0, 0.0, 0.0, 136.0, 136.0, 2.0, 26.0, 6.0, 14.0, 7.0, 3.0, 83.0, 136.0, 24.0, 136.0, 8.0, 0.0, 0.0, 0.0, 12.0, 57.0, 116.0, 57.0, 2.0, 0.0, 0.0, 0.0, 5.0, 22.0, 100.0, 26.0, 109.0, 39.0, 9.0, 11.0, 31.0, 16.0, 0.0, 25.0, 13.0, 30.0, 35.0, 40.0, 36.0, 2.0, 5.0, 136.0, 20.0, 0.0, 2.0, 1.0, 13.0, 12.0, 38.0, 27.0, 11.0, 1.0, 0.0, 0.0, 15.0, 28.0, 84.0, 19.0, 20.0, 0.0, 0.0, 22.0, 58.0, 1.0, 3.0, 29.0, 1.0, 0.0, 3.0, 37.0, 49.0, 2.0, 16.0, 136.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 22.0, 29.0, 11.0, 3.0, 2.0, 0.0, 0.0, 0.0, 4.0}"
"{7.0, 2.0, 5.0, 1.0, 0.0, 1.0, 10.0, 58.0, 15.0, 0.0, 6.0, 54.0, 29.0, 16.0, 11.0, 75.0, 132.0, 6.0, 5.0, 49.0, 43.0, 13.0, 2.0, 28.0, 132.0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 38.0, 2.0, 9.0, 95.0, 47.0, 0.0, 0.0, 3.0, 14.0, 8.0, 2.0, 44.0, 37.0, 12.0, 23.0, 36.0, 47.0, 131.0, 35.0, 15.0, 7.0, 22.0, 17.0, 14.0, 28.0, 132.0, 49.0, 0.0, 0.0, 0.0, 0.0, 0.0, 58.0, 4.0, 4.0, 73.0, 61.0, 3.0, 0.0, 0.0, 2.0, 33.0, 15.0, 132.0, 132.0, 2.0, 1.0, 0.0, 13.0, 84.0, 83.0, 132.0, 64.0, 2.0, 0.0, 1.0, 7.0, 132.0, 89.0, 15.0, 0.0, 0.0, 0.0, 0.0, 12.0, 3.0, 31.0, 20.0, 13.0, 3.0, 2.0, 1.0, 1.0, 30.0, 77.0, 90.0, 8.0, 0.0, 0.0, 0.0, 10.0, 11.0, 43.0, 114.0, 22.0, 0.0, 0.0, 0.0, 1.0, 28.0, 21.0, 32.0, 5.0, 0.0, 0.0, 1.0, 5.0}"
"{5.0, 18.0, 20.0, 27.0, 14.0, 30.0, 9.0, 2.0, 7.0, 14.0, 4.0, 0.0, 0.0, 21.0, 81.0, 39.0, 62.0, 6.0, 2.0, 0.0, 0.0, 3.0, 47.0, 95.0, 41.0, 9.0, 5.0, 3.0, 0.0, 0.0, 0.0, 25.0, 0.0, 3.0, 2.0, 5.0, 101.0, 105.0, 7.0, 0.0, 0.0, 0.0, 1.0, 5.0, 14.0, 34.0, 60.0, 23.0, 126.0, 5.0, 1.0, 0.0, 4.0, 2.0, 39.0, 98.0, 126.0, 12.0, 7.0, 5.0, 4.0, 2.0, 1.0, 58.0, 0.0, 0.0, 48.0, 126.0, 44.0, 27.0, 0.0, 0.0, 0.0, 23.0, 126.0, 29.0, 13.0, 4.0, 2.0, 2.0, 126.0, 126.0, 85.0, 3.0, 6.0, 0.0, 2.0, 19.0, 67.0, 59.0, 28.0, 1.0, 2.0, 1.0, 2.0, 54.0, 1.0, 1.0, 78.0, 108.0, 0.0, 0.0, 0.0, 2.0, 1.0, 39.0, 126.0, 43.0, 2.0, 1.0, 0.0, 0.0, 3.0, 126.0, 115.0, 3.0, 3.0, 0.0, 2.0, 1.0, 0.0, 23.0, 24.0, 7.0, 18.0, 3.0, 4.0, 0.0}"
"{4.0, 3.0, 0.0, 0.0, 0.0, 26.0, 42.0, 10.0, 7.0, 5.0, 4.0, 2.0, 1.0, 54.0, 126.0, 15.0, 27.0, 1.0, 1.0, 1.0, 2.0, 55.0, 69.0, 56.0, 24.0, 7.0, 16.0, 4.0, 4.0, 0.0, 0.0, 23.0, 2.0, 0.0, 0.0, 4.0, 46.0, 94.0, 61.0, 7.0, 1.0, 0.0, 4.0, 2.0, 40.0, 96.0, 126.0, 6.0, 87.0, 3.0, 6.0, 0.0, 3.0, 17.0, 126.0, 126.0, 118.0, 3.0, 4.0, 0.0, 2.0, 1.0, 3.0, 126.0, 5.0, 0.0, 0.0, 21.0, 79.0, 41.0, 6.0, 14.0, 1.0, 5.0, 15.0, 34.0, 58.0, 23.0, 0.0, 0.0, 126.0, 31.0, 13.0, 4.0, 2.0, 2.0, 0.0, 23.0, 126.0, 45.0, 2.0, 1.0, 0.0, 0.0, 1.0, 39.0, 22.0, 26.0, 16.0, 32.0, 9.0, 2.0, 5.0, 16.0, 2.0, 4.0, 100.0, 108.0, 7.0, 0.0, 0.0, 2.0, 48.0, 126.0, 41.0, 26.0, 0.0, 0.0, 0.0, 0.0, 76.0, 107.0, 0.0, 0.0, 0.0, 2.0, 1.0, 1.0}"
"{35.0, 10.0, 0.0, 0.0, 0.0, 7.0, 34.0, 18.0, 11.0, 3.0, 0.0, 0.0, 0.0, 82.0, 122.0, 22.0, 10.0, 0.0, 3.0, 25.0, 79.0, 40.0, 89.0, 58.0, 3.0, 0.0, 10.0, 68.0, 99.0, 8.0, 5.0, 6.0, 3.0, 2.0, 0.0, 0.0, 17.0, 122.0, 78.0, 8.0, 41.0, 11.0, 2.0, 6.0, 17.0, 122.0, 122.0, 21.0, 122.0, 12.0, 5.0, 6.0, 7.0, 10.0, 56.0, 122.0, 22.0, 2.0, 17.0, 75.0, 105.0, 62.0, 0.0, 14.0, 7.0, 40.0, 24.0, 5.0, 27.0, 122.0, 10.0, 2.0, 24.0, 39.0, 81.0, 45.0, 10.0, 13.0, 3.0, 0.0, 122.0, 25.0, 21.0, 17.0, 8.0, 14.0, 13.0, 122.0, 38.0, 14.0, 20.0, 23.0, 62.0, 88.0, 5.0, 51.0, 30.0, 52.0, 8.0, 3.0, 2.0, 14.0, 5.0, 6.0, 3.0, 10.0, 42.0, 26.0, 4.0, 12.0, 15.0, 8.0, 16.0, 14.0, 28.0, 36.0, 7.0, 6.0, 10.0, 20.0, 32.0, 20.0, 3.0, 4.0, 1.0, 5.0, 8.0, 24.0}"
"{13.0, 13.0, 16.0, 5.0, 1.0, 4.0, 3.0, 4.0, 10.0, 7.0, 4.0, 15.0, 34.0, 44.0, 26.0, 4.0, 89.0, 8.0, 0.0, 19.0, 47.0, 16.0, 12.0, 37.0, 75.0, 9.0, 3.0, 2.0, 2.0, 0.0, 0.0, 24.0, 5.0, 10.0, 28.0, 32.0, 17.0, 25.0, 28.0, 9.0, 1.0, 10.0, 30.0, 52.0, 33.0, 77.0, 40.0, 4.0, 117.0, 35.0, 2.0, 24.0, 21.0, 16.0, 24.0, 44.0, 117.0, 102.0, 13.0, 10.0, 2.0, 0.0, 0.0, 10.0, 36.0, 18.0, 67.0, 64.0, 16.0, 12.0, 16.0, 61.0, 23.0, 11.0, 117.0, 117.0, 8.0, 1.0, 1.0, 22.0, 107.0, 117.0, 114.0, 117.0, 8.0, 0.0, 0.0, 8.0, 110.0, 117.0, 10.0, 12.0, 3.0, 0.0, 0.0, 1.0, 42.0, 0.0, 0.0, 1.0, 13.0, 17.0, 44.0, 86.0, 37.0, 1.0, 19.0, 19.0, 4.0, 22.0, 89.0, 109.0, 20.0, 48.0, 57.0, 18.0, 3.0, 14.0, 49.0, 94.0, 17.0, 24.0, 2.0, 1.0, 1.0, 0.0, 8.0, 37.0}"
"{31.0, 0.0, 0.0, 0.0, 0.0, 11.0, 17.0, 27.0, 22.0, 2.0, 0.0, 0.0, 2.0, 86.0, 52.0, 18.0, 91.0, 27.0, 0.0, 0.0, 0.0, 15.0, 34.0, 82.0, 16.0, 3.0, 0.0, 1.0, 20.0, 22.0, 10.0, 28.0, 70.0, 3.0, 2.0, 2.0, 37.0, 53.0, 15.0, 58.0, 27.0, 5.0, 0.0, 0.0, 38.0, 128.0, 62.0, 18.0, 128.0, 6.0, 0.0, 0.0, 0.0, 106.0, 97.0, 128.0, 60.0, 1.0, 0.0, 1.0, 14.0, 114.0, 42.0, 62.0, 20.0, 4.0, 6.0, 4.0, 25.0, 93.0, 25.0, 17.0, 3.0, 49.0, 6.0, 0.0, 21.0, 128.0, 11.0, 0.0, 128.0, 128.0, 4.0, 0.0, 1.0, 42.0, 5.0, 26.0, 47.0, 21.0, 9.0, 6.0, 13.0, 51.0, 9.0, 21.0, 1.0, 22.0, 9.0, 9.0, 62.0, 33.0, 0.0, 0.0, 1.0, 128.0, 72.0, 5.0, 11.0, 27.0, 0.0, 0.0, 36.0, 101.0, 45.0, 12.0, 6.0, 6.0, 7.0, 9.0, 8.0, 3.0, 1.0, 2.0, 16.0, 38.0, 12.0, 5.0}"
"{120.0, 15.0, 0.0, 0.0, 0.0, 8.0, 8.0, 10.0, 34.0, 0.0, 0.0, 0.0, 1.0, 120.0, 89.0, 25.0, 16.0, 0.0, 0.0, 1.0, 3.0, 39.0, 120.0, 120.0, 26.0, 0.0, 0.0, 11.0, 70.0, 7.0, 19.0, 26.0, 111.0, 16.0, 0.0, 0.0, 0.0, 105.0, 49.0, 16.0, 3.0, 0.0, 0.0, 0.0, 1.0, 120.0, 83.0, 8.0, 120.0, 2.0, 0.0, 0.0, 0.0, 20.0, 55.0, 98.0, 120.0, 1.0, 4.0, 10.0, 55.0, 39.0, 13.0, 46.0, 16.0, 0.0, 0.0, 0.0, 8.0, 87.0, 31.0, 8.0, 8.0, 0.0, 0.0, 0.0, 0.0, 36.0, 34.0, 14.0, 120.0, 89.0, 6.0, 6.0, 11.0, 7.0, 12.0, 31.0, 64.0, 24.0, 4.0, 6.0, 26.0, 54.0, 117.0, 25.0, 0.0, 0.0, 0.0, 2.0, 16.0, 7.0, 1.0, 0.0, 11.0, 0.0, 0.0, 2.0, 2.0, 0.0, 0.0, 2.0, 120.0, 26.0, 2.0, 4.0, 25.0, 28.0, 19.0, 69.0, 3.0, 6.0, 1.0, 4.0, 57.0, 52.0, 24.0, 12.0}"
@yoloVoe
Copy link
Contributor Author

yoloVoe commented Sep 4, 2023

Note that BUILD_VIA_INSERTS must be set to ON in CMakeLists.txt to repro the issue.

In particular, this means we need this PR: #114 to repro.

@yoloVoe yoloVoe changed the title cost estimate fix Postgres isn't always using hnsw index - Update cost estimate? Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant