diff --git a/test/expected/hnsw_streaming.out b/test/expected/hnsw_streaming.out
new file mode 100644
index 000000000..91b852a6c
--- /dev/null
+++ b/test/expected/hnsw_streaming.out
@@ -0,0 +1,100 @@
+SELECT t,
+Array[t,t+1,t+2]::vector(3) AS val
+INTO test_where
+FROM generate_series(1, 2000) as t;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+  t   
+------
+ 1501
+ 1502
+(2 rows)
+
+CREATE INDEX test_where_idx ON test_where USING hnsw (val vector_l2_ops) WITH (m=10);
+set hnsw.streaming=off;
+set hnsw.ef_search=100;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+ t 
+---
+(0 rows)
+
+set hnsw.streaming=on;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+  t   
+------
+ 1501
+ 1502
+(2 rows)
+
+SELECT t FROM test_where WHERE t>2000 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+ t 
+---
+(0 rows)
+
+DELETE FROM test_where;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+ t 
+---
+(0 rows)
+
+TRUNCATE test_where;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+ t 
+---
+(0 rows)
+
+DROP TABLE test_where;
+SET enable_seqscan = off;
+CREATE TABLE t (val vector(3));
+INSERT INTO t (val) VALUES ('[0,0,0]'), ('[1,2,3]'), ('[1,1,1]'), (NULL);
+CREATE INDEX t_idx ON t USING hnsw (val vector_l2_ops);
+INSERT INTO t (val) VALUES ('[1,2,4]');
+SELECT * FROM t ORDER BY val <-> '[3,3,3]';
+   val   
+---------
+ [1,2,3]
+ [1,2,4]
+ [1,1,1]
+ [0,0,0]
+(4 rows)
+
+SELECT COUNT(*) FROM (SELECT * FROM t ORDER BY val <-> (SELECT NULL::vector)) t2;
+ count 
+-------
+     4
+(1 row)
+
+SELECT COUNT(*) FROM t;
+ count 
+-------
+     5
+(1 row)
+
+TRUNCATE t;
+SELECT * FROM t ORDER BY val <-> '[3,3,3]';
+ val 
+-----
+(0 rows)
+
+DROP TABLE t;
+SET enable_seqscan = off;
+CREATE TABLE t (val vector(3));
+INSERT INTO t (val) VALUES ('[0,0,0]'), ('[1,2,3]'), ('[1,1,1]'), (NULL);
+CREATE INDEX t_idx ON t USING hnsw (val vector_ip_ops);
+INSERT INTO t (val) VALUES ('[1,2,4]');
+SELECT * FROM t ORDER BY val <#> '[3,3,3]';
+   val   
+---------
+ [1,2,4]
+ [1,2,3]
+ [1,1,1]
+ [0,0,0]
+(4 rows)
+
+SELECT COUNT(*) FROM (SELECT * FROM t ORDER BY val <#> (SELECT NULL::vector)) t2;
+ count 
+-------
+     4
+(1 row)
+
+DROP TABLE t;
+set hnsw.streaming=off;
diff --git a/test/sql/hnsw_streaming.sql b/test/sql/hnsw_streaming.sql
new file mode 100644
index 000000000..75f4a3855
--- /dev/null
+++ b/test/sql/hnsw_streaming.sql
@@ -0,0 +1,47 @@
+SELECT t,
+Array[t,t+1,t+2]::vector(3) AS val
+INTO test_where
+FROM generate_series(1, 2000) as t;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+CREATE INDEX test_where_idx ON test_where USING hnsw (val vector_l2_ops) WITH (m=10);
+set hnsw.streaming=off;
+set hnsw.ef_search=100;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+set hnsw.streaming=on;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+SELECT t FROM test_where WHERE t>2000 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+DELETE FROM test_where;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+TRUNCATE test_where;
+SELECT t FROM test_where WHERE t>1500 ORDER BY val <-> '[1000.2,1000,1000.1]' LIMIT 2;
+DROP TABLE test_where;
+SET enable_seqscan = off;
+
+CREATE TABLE t (val vector(3));
+INSERT INTO t (val) VALUES ('[0,0,0]'), ('[1,2,3]'), ('[1,1,1]'), (NULL);
+CREATE INDEX t_idx ON t USING hnsw (val vector_l2_ops);
+
+INSERT INTO t (val) VALUES ('[1,2,4]');
+
+SELECT * FROM t ORDER BY val <-> '[3,3,3]';
+SELECT COUNT(*) FROM (SELECT * FROM t ORDER BY val <-> (SELECT NULL::vector)) t2;
+SELECT COUNT(*) FROM t;
+
+TRUNCATE t;
+SELECT * FROM t ORDER BY val <-> '[3,3,3]';
+
+DROP TABLE t;
+SET enable_seqscan = off;
+
+CREATE TABLE t (val vector(3));
+INSERT INTO t (val) VALUES ('[0,0,0]'), ('[1,2,3]'), ('[1,1,1]'), (NULL);
+CREATE INDEX t_idx ON t USING hnsw (val vector_ip_ops);
+
+INSERT INTO t (val) VALUES ('[1,2,4]');
+
+SELECT * FROM t ORDER BY val <#> '[3,3,3]';
+SELECT COUNT(*) FROM (SELECT * FROM t ORDER BY val <#> (SELECT NULL::vector)) t2;
+
+DROP TABLE t;
+
+set hnsw.streaming=off;
