pg.ddx.io pgvector/pgvector GitHub issues and pull requests
help / color / mirror / Atom feed[pgvector/pgvector] PR #282: Hnsw iterator
33+ messages / 5 participants
[nested] [flat]
* [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-27 06:33 "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
0 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-27 06:33 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
See #259 for motivation of this PR.
In few words - if we wan to perform filtering after HNSW search, then `K=hnsw_ef_search` may be not enough to provide enough results to upper plan nodes.
Assume `hnsw_ef_seach=10`.
If we perform query:
```
select * from documents order by embedding<->array[...]::vector limit 10;
```
then it returns 10 result and it is ok.
If with the same `hnsw_ef_seach=10`. we execute query:
```
select * from documents order by embedding<->array[...]::vector limit 100;
```
and it still returns 10 results it is no so good. But at least here we can easily change`hnsw-ef-search` to 100 and get proper number of results.
But if we do
```
select * from documents where category in (1,2,3) order by embedding<->array[...]::vector limit 10;
```
and it returns 0 results, then we do not know whether there are actually no documents belonging to this categories or them just too far from specified point. And it is not clear how to increase `hnsw_ef_search` to return proper number of results.
There are three possible solutions of the problem:
1. Push down filter condition to SearchKNN method and perform filtering before cutting K results. Unfortunately Postgres index AM doesn't allow to do it.
2. Repeat search with larger `ef_search`. This is what I have implemented in my previous PR: #266. This solution has two drawbacks:
- double amount of works caused by query retry
- not strict order of returns results
3. Implement iterator which usable to return all elements in increasing distance order.
Approach 3 I tried to implement in this PR. It is similar with how KNN is implemented in Postgres for GIST indexes.
The main difference between GIST and HNSW is that first one is using wrapping rectangles which allows to cut traverse tree without sorting all elements. If we have wrapping rectangles A=[(ax1,ay1),(ax2,ay2)] and B=[(bx1,by1),(bx2,by2)] and search for points closer to (x,y), then if x<ax1 and ax2<bx1 and y<ay1 and ay2<by1, then we can traverse first all siblings of A and then all siblings of B.
Unfortunately fir HNSW it doesn't work: if we have two vectors V1, V2 and search vector V and `V1<->V < V2<->V` (distance between V1 and V is smaller than distance between V2 and V), then it doesn't mean that the same is true for all neighbours of V1 and V2. So unlike GIST we can not provide strict order, in other words we can return vector with larger distance prior to vector with smaller distance. But as far as our search is approximate in any case, it seems to be ok.
How HNSW search was implemented before? We recursively traverse vertexes at each layer, marking them as visible and rejecting candidates with distance large than already chosen. The search is repeated for each layer. For intermediate layers `ef=1` (which means that we choose only one candidate) and for leaf layer = `ef=hnsw_ef_search`. For each layer we use hash for marking listed vertexes and two pairing heaps: for maintaining sorted sets of candidates and results.
Iterator need to keep state of recursive traversal of all layers. So we create stack (array) with number of elements equal to number of layers and each element contains hash and 2 pairing heaps. We can not reject elements with larger distance, because them have to be traversed I any case. We just put all of them in pairing heap. To prevent memory overflow we stop traversal if we have found enough results (1 for internal layer and `hnsw_ef_search` for leaf layer) and there are no more candidates at distance less or equal than distance to the n-th already chosen result.
Similar think was already implemented in TImescaleDB HNSW index implementation:
https://news.ycombinator.com/item?id=37648913
Also related links:
https://medium.com/pinterest-engineering/manas-hnsw-streaming-filters-351adf9ac1c4
https://towardsdatascience.com/effects-of-filtered-hnsw-searches-on-recall-and-latency-434becf8041c
inline patch 1: src/hnsw.c, src/hnsw.h, src/hnswscan.c and 2 more (+275/-42 lines) download inline-1.patch
diff --git a/src/hnsw.c b/src/hnsw.c
index 758e41842..c174da40e 100644
--- a/src/hnsw.c
+++ b/src/hnsw.c
@@ -14,6 +14,8 @@
#endif
int hnsw_ef_search;
+bool hnsw_enable_iterator;
+bool hnsw_strict_order;
static relopt_kind hnsw_relopt_kind;
/*
@@ -39,6 +41,12 @@ HnswInit(void)
DefineCustomIntVariable("hnsw.ef_search", "Sets the size of the dynamic candidate list for search",
"Valid range is 1..1000.", &hnsw_ef_search,
HNSW_DEFAULT_EF_SEARCH, HNSW_MIN_EF_SEARCH, HNSW_MAX_EF_SEARCH, PGC_USERSET, 0, NULL, NULL, NULL);
+ DefineCustomBoolVariable("hnsw.enable_iterator", "Use iterator to support filtering",
+ NULL, &hnsw_enable_iterator,
+ true, PGC_USERSET, 0, NULL, NULL, NULL);
+ DefineCustomBoolVariable("hnsw.strict_order", "Provide string order of returned results in HNSW iterator",
+ "Skip results with violates distance order", &hnsw_strict_order,
+ false, PGC_USERSET, 0, NULL, NULL, NULL);
}
/*
diff --git a/src/hnsw.h b/src/hnsw.h
index cfba560b1..adc71e64d 100644
--- a/src/hnsw.h
+++ b/src/hnsw.h
@@ -88,6 +88,8 @@
/* Variables */
extern int hnsw_ef_search;
+extern bool hnsw_enable_iterator;
+extern bool hnsw_strict_order;
typedef struct HnswNeighborArray HnswNeighborArray;
@@ -215,13 +217,28 @@ typedef struct HnswNeighborTupleData
typedef HnswNeighborTupleData * HnswNeighborTuple;
+typedef struct
+{
+ pairingheap *C;
+ pairingheap *W;
+ HTAB* v;
+ int n;
+} LayerScanDesc;
+
typedef struct HnswScanOpaqueData
{
bool first;
List *w;
MemoryContext tmpCtx;
- /* Support functions */
+ LayerScanDesc* layers;
+ int n_layers;
+ int m;
+ Datum q;
+ float last_distance;
+ HnswCandidate *hc;
+
+ /* Support functions */
FmgrInfo *procinfo;
FmgrInfo *normprocinfo;
Oid collation;
@@ -285,6 +302,8 @@ void HnswLoadElement(HnswElement element, float *distance, Datum *q, Relation i
void HnswSetElementTuple(HnswElementTuple etup, HnswElement element);
void HnswUpdateConnection(HnswElement element, HnswCandidate * hc, int m, int lc, int *updateIdx, Relation index, FmgrInfo *procinfo, Oid collation);
void HnswLoadNeighbors(HnswElement element, Relation index, int m);
+HnswCandidate* HnswGetNext(IndexScanDesc scan);
+void HnswInitScan(IndexScanDesc scan, Datum q);
/* Index access methods */
IndexBuildResult *hnswbuild(Relation heap, Relation index, IndexInfo *indexInfo);
diff --git a/src/hnswscan.c b/src/hnswscan.c
index d391a10d7..240f96f9c 100644
--- a/src/hnswscan.c
+++ b/src/hnswscan.c
@@ -1,3 +1,4 @@
+#include <float.h>
#include "postgres.h"
#include "access/relscan.h"
@@ -7,36 +8,33 @@
#include "storage/lmgr.h"
#include "utils/memutils.h"
-/*
- * Algorithm 5 from paper
- */
static List *
GetScanItems(IndexScanDesc scan, Datum q)
{
- HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
- Relation index = scan->indexRelation;
- FmgrInfo *procinfo = so->procinfo;
- Oid collation = so->collation;
- List *ep;
- List *w;
- int m;
- HnswElement entryPoint;
-
- /* Get m and entry point */
- HnswGetMetaPageInfo(index, &m, &entryPoint);
-
- if (entryPoint == NULL)
- return NIL;
-
- ep = list_make1(HnswEntryCandidate(entryPoint, q, index, procinfo, collation, false));
-
- for (int lc = entryPoint->level; lc >= 1; lc--)
- {
- w = HnswSearchLayer(q, ep, 1, lc, index, procinfo, collation, m, false, NULL);
- ep = w;
- }
-
- return HnswSearchLayer(q, ep, hnsw_ef_search, 0, index, procinfo, collation, m, false, NULL);
+ HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
+ Relation index = scan->indexRelation;
+ FmgrInfo *procinfo = so->procinfo;
+ Oid collation = so->collation;
+ List *ep;
+ List *w;
+ int m;
+ HnswElement entryPoint;
+
+ /* Get m and entry point */
+ HnswGetMetaPageInfo(index, &m, &entryPoint);
+
+ if (entryPoint == NULL)
+ return NIL;
+
+ ep = list_make1(HnswEntryCandidate(entryPoint, q, index, procinfo, collation, false));
+
+ for (int lc = entryPoint->level; lc >= 1; lc--)
+ {
+ w = HnswSearchLayer(q, ep, 1, lc, index, procinfo, collation, m, false, NULL);
+ ep = w;
+ }
+
+ return HnswSearchLayer(q, ep, hnsw_ef_search, 0, index, procinfo, collation, m, false, NULL);
}
/*
@@ -142,6 +140,7 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir)
{
HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
MemoryContext oldCtx = MemoryContextSwitchTo(so->tmpCtx);
+ HnswCandidate *hc;
/*
* Index can be used to scan backward, but Postgres doesn't support
@@ -163,29 +162,50 @@ hnswgettuple(IndexScanDesc scan, ScanDirection dir)
/* Get scan value */
value = GetScanValue(scan);
- /*
- * Get a shared lock. This allows vacuum to ensure no in-flight scans
- * before marking tuples as deleted.
- */
- LockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);
-
- so->w = GetScanItems(scan, value);
-
- /* Release shared lock */
- UnlockPage(scan->indexRelation, HNSW_SCAN_LOCK, ShareLock);
+ if (hnsw_enable_iterator)
+ HnswInitScan(scan, value);
+ else
+ so->w = GetScanItems(scan, value);
+ so->last_distance = 0;
so->first = false;
}
- while (list_length(so->w) > 0)
+ while (hnsw_enable_iterator || list_length(so->w) > 0)
{
- HnswCandidate *hc = llast(so->w);
ItemPointer heaptid;
+ if (hnsw_enable_iterator)
+ {
+ hc = so->hc;
+ if (hc == NULL)
+ {
+ do
+ {
+ hc = HnswGetNext(scan);
+ if (hc == NULL)
+ break;
+ }
+ while (hnsw_strict_order && hc->distance < so->last_distance);
+
+ if (hc == NULL)
+ break;
+
+ so->last_distance = hc->distance;
+ so->hc = hc;
+ }
+ }
+ else
+ {
+ hc = llast(so->w);
+ }
/* Move to next element if no valid heap TIDs */
if (list_length(hc->element->heaptids) == 0)
{
- so->w = list_delete_last(so->w);
+ if (hnsw_enable_iterator)
+ so->hc = NULL;
+ else
+ so->w = list_delete_last(so->w);
continue;
}
diff --git a/src/hnswutils.c b/src/hnswutils.c
index 72cf94ea2..4f8067ccf 100644
--- a/src/hnswutils.c
+++ b/src/hnswutils.c
@@ -2,6 +2,7 @@
#include <math.h>
+#include "access/relscan.h"
#include "hnsw.h"
#include "storage/bufmgr.h"
#include "vector.h"
@@ -564,6 +565,191 @@ AddToVisited(HTAB *v, HnswCandidate * hc, Relation index, bool *found)
}
}
+
+static void
+AddCandidate(IndexScanDesc scan, int lc, HnswCandidate *hc)
+{
+ HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
+ LayerScanDesc* layer = &so->layers[lc];
+ bool visited;
+ AddToVisited(layer->v, hc, scan->indexRelation, &visited);
+ if (!visited)
+ {
+ pairingheap_add(layer->C, &(CreatePairingHeapNode(hc)->ph_node));
+ pairingheap_add(layer->W, &(CreatePairingHeapNode(hc)->ph_node));
+ layer->n += lc != 0 || list_length(hc->element->heaptids) != 0;
+ }
+}
+
+void
+HnswInitScan(IndexScanDesc scan, Datum q)
+{
+ HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
+ HnswElement entryPoint;
+ Relation index = scan->indexRelation;
+ int i;
+ HASHCTL hash_ctl;
+ HnswCandidate *hc;
+
+ /* Create hash table */
+ hash_ctl.hcxt = CurrentMemoryContext;
+ if (index == NULL)
+ {
+ hash_ctl.keysize = sizeof(HnswElement *);
+ hash_ctl.entrysize = sizeof(HnswElement *);
+ }
+ else
+ {
+ hash_ctl.keysize = sizeof(ItemPointerData);
+ hash_ctl.entrysize = sizeof(ItemPointerData);
+ }
+
+ so->hc = NULL;
+ so->q = q;
+
+ /* Get m and entry point */
+ HnswGetMetaPageInfo(index, &so->m, &entryPoint);
+ if (entryPoint == NULL)
+ {
+ so->n_layers = 0;
+ so->layers = NULL;
+ return;
+ }
+ hc = HnswEntryCandidate(entryPoint, q, index, so->procinfo, so->collation, false);
+ so->n_layers = entryPoint->level + 1;
+ so->layers = (LayerScanDesc*)palloc(sizeof(LayerScanDesc) * so->n_layers);
+ for (i = 0; i < so->n_layers; i++)
+ {
+ so->layers[i].C = pairingheap_allocate(CompareNearestCandidates, NULL);
+ so->layers[i].W = pairingheap_allocate(CompareNearestCandidates, NULL);
+ so->layers[i].v = hash_create("hnsw visited", 256, &hash_ctl, HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
+ so->layers[i].n = 0;
+ }
+ AddCandidate(scan, so->n_layers-1, hc);
+}
+
+static pairingheap_node *
+pairingheap_nth(pairingheap *heap, int nth)
+{
+ if (nth > 0) {
+ pairingheap_node* first = pairingheap_remove_first(heap);
+ pairingheap_node* result = pairingheap_nth(heap, nth-1);
+ pairingheap_add(heap, first);
+ return result;
+ }
+ else
+ {
+ return pairingheap_first(heap);
+ }
+}
+
+static bool
+MoreCandidates(IndexScanDesc scan, int lc, int ef)
+{
+ HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
+ Relation index = scan->indexRelation;
+ LayerScanDesc* layer = &so->layers[lc];
+
+ while (!pairingheap_is_empty(layer->C))
+ {
+ HnswNeighborArray *neighborhood;
+ HnswCandidate *c = ((HnswPairingHeapNode *) pairingheap_first(layer->C))->inner;
+ if (layer->n >= ef && c->distance > ((HnswPairingHeapNode*) pairingheap_nth(layer->W, ef - 1))->inner->distance)
+ return true;
+
+ pairingheap_remove_first(layer->C);
+
+ if (c->element->neighbors == NULL)
+ HnswLoadNeighbors(c->element, index, so->m);
+
+ /* Get the neighborhood at layer lc */
+ neighborhood = &c->element->neighbors[lc];
+
+ for (int i = 0; i < neighborhood->length; i++)
+ {
+ HnswCandidate *e = &neighborhood->items[i];
+ bool visited;
+
+
+ AddToVisited(layer->v, e, index, &visited);
+
+ if (!visited)
+ {
+ float eDistance;
+ HnswCandidate *ec;
+
+ if (index == NULL)
+ eDistance = GetCandidateDistance(e, so->q, so->procinfo, so->collation);
+ else
+ HnswLoadElement(e->element, &eDistance, &so->q, index, so->procinfo, so->collation, false);
+
+ Assert(!e->element->deleted);
+
+ /* Make robust to issues */
+ if (e->element->level < lc)
+ continue;
+
+ /* Copy e */
+ ec = palloc(sizeof(HnswCandidate));
+
+ ec->element = e->element;
+ ec->distance = eDistance;
+
+ pairingheap_add(layer->C, &(CreatePairingHeapNode(ec)->ph_node));
+ pairingheap_add(layer->W, &(CreatePairingHeapNode(ec)->ph_node));
+ layer->n += lc != 0 || list_length(ec->element->heaptids) != 0;
+ }
+ }
+ }
+ return false;
+}
+
+static HnswCandidate*
+GetCandidate(IndexScanDesc scan, int lc, int ef)
+{
+ HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
+ LayerScanDesc* layer = &so->layers[lc];
+ while (true)
+ {
+ if (!MoreCandidates(scan, lc, ef))
+ {
+ if (lc+1 != so->n_layers)
+ {
+ HnswCandidate* hc = GetCandidate(scan, lc+1, 1);
+ if (hc != NULL)
+ {
+ AddCandidate(scan, lc, hc);
+ continue;
+ }
+ }
+ break;
+ }
+ else if (layer->n >= ef)
+ {
+ /* Collect enough results to return the best */
+ break;
+ }
+ }
+ if (pairingheap_is_empty(layer->W))
+ {
+ return NULL;
+ }
+ else
+ {
+ HnswCandidate* hc = ((HnswPairingHeapNode *) pairingheap_remove_first(layer->W))->inner;
+ layer->n -= lc != 0 || list_length(hc->element->heaptids) != 0;
+ return hc;
+ }
+}
+
+HnswCandidate*
+HnswGetNext(IndexScanDesc scan)
+{
+ HnswScanOpaque so = (HnswScanOpaque) scan->opaque;
+ return so->n_layers == 0 ? NULL : GetCandidate(scan, 0, hnsw_ef_search);
+}
+
+
/*
* Algorithm 2 from paper
*/
diff --git a/test/t/015_hnsw_duplicates.pl b/test/t/015_hnsw_duplicates.pl
index 7e11deed3..f9b142f92 100644
--- a/test/t/015_hnsw_duplicates.pl
+++ b/test/t/015_hnsw_duplicates.pl
@@ -28,7 +28,7 @@ sub test_duplicates
SET hnsw.ef_search = 1;
SELECT COUNT(*) FROM (SELECT * FROM tst ORDER BY v <-> '[1,1,1]') t;
));
- is($res, 10);
+ is($res, 20);
}
# Test duplicates with build
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-27 21:00 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: jkatz (@jkatz) @ 2023-09-27 21:00 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@knizhnik Can you please provide a summary/description of what this patchset does? I didn't see anything in the commit messages, and I want to evaluate it holistically. Thanks!
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-27 21:03 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: jkatz (@jkatz) @ 2023-09-27 21:03 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Are there any tests/benchmarks comparing this updated method to the older method? How does this impact performance/recall?
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-28 15:52 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-28 15:52 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> @knizhnik Can you please provide a summary/description of what this patchset does? I didn't see anything in the commit messages, and I want to evaluate it holistically. Thanks!
Done
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-28 15:56 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-28 15:56 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Are there any tests/benchmarks comparing this updated method to the older method? How does this impact performance/recall?
Results on OpenAI dataset (1M embeddings with 1636 dimension).
The query is `SELECT _id, openai_vector <-> ARRAY[...]::vector as dist from documents order by dist LIMIT 10;`
```
postgres=# set hnsw.enable_iterator = on;
SET
Time: 0.136 ms
postgres=# \i ~/ann-benchmarks/openai-pgvector.sql
_id | dist
------------------------------------------------+--------------------
<dbpedia:Paris> | 0.5149979680215692
<dbpedia:Economy_of_Paris> | 0.5322160352313228
<dbpedia:List_of_tourist_attractions_in_Paris> | 0.5556925144520639
<dbpedia:Capitale-Nationale> | 0.560634247353793
<dbpedia:Besançon> | 0.5639481182838457
<dbpedia:Captal> | 0.5744128256080486
<dbpedia:Palais_de_Justice,_Paris> | 0.5744524110550726
<dbpedia:Laon> | 0.5754102943098868
<dbpedia:Hôtel_de_Ville,_Paris> | 0.5779674934070351
<dbpedia:Timeline_of_Paris> | 0.5780753294768416
(10 rows)
Time: 4.177 ms
postgres=# set hnsw.enable_iterator = off;
SET
Time: 0.110 ms
postgres=# \i ~/ann-benchmarks/openai-pgvector.sql
_id | dist
------------------------------------------------+--------------------
<dbpedia:Paris> | 0.5149979680215692
<dbpedia:Economy_of_Paris> | 0.5322160352313228
<dbpedia:List_of_tourist_attractions_in_Paris> | 0.5556925144520639
<dbpedia:Capitale-Nationale> | 0.560634247353793
<dbpedia:Besançon> | 0.5639481182838457
<dbpedia:Captal> | 0.5744128256080486
<dbpedia:Palais_de_Justice,_Paris> | 0.5744524110550726
<dbpedia:Laon> | 0.5754102943098868
<dbpedia:Hôtel_de_Ville,_Paris> | 0.5779674934070351
<dbpedia:Timeline_of_Paris> | 0.5780753294768416
(10 rows)
Time: 3.545 ms
```
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-28 16:22 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-09-28 16:22 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Does this produce different results than current 'master', if you stop the iteration so that you get the same number of results?
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-28 18:24 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-28 18:24 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Does this produce different results than current 'master', if you stop the iteration so that you get the same number of results?
Right now results are identical.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-29 09:33 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-09-29 09:33 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
(on src/hnswutils.c:624)
W should use `CompareFurthestCandidates`
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-29 14:05 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-29 14:05 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
(on src/hnswutils.c:624)
> W should use `CompareFurthestCandidates`
Actually it is not completely true. pgvector really uses reverse (distance descending) order for W, because
1. It needs to get largest distance already selected in W
2. Be able to replace item with largest distance with better candidate.
We do not need 2 and we need to extract best candidate from W (with smallest distance).
In the original pgvector implementation it is solved by extracting all elements and appending them to the list (so finally in the list them are in correct distance ascending order).
But in case of iterator I need to select just one best item.
But you was right - I incorrectly used pairingheap_first to get the largest distance. It is fixed now.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-29 16:00 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-09-29 16:00 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
(on src/hnswutils.c:624)
> > W should use `CompareFurthestCandidates`
>
> Actually it is not completely true. pgvector really uses reverse (distance descending) order for W, because
>
> 1. It needs to get largest distance already selected in W
>
> 2. Be able to replace item with largest distance with better candidate.
>
>
> We do not need 2 and we need to extract best candidate from W (with smallest distance). In the original pgvector implementation it is solved by extracting all elements and appending them to the list (so finally in the list them are in correct distance ascending order). But in case of iterator I need to select just one best item.
Hmm, so to implement 1, you now keep track of the maximum distance seen separately. That won't produce the same results as without this. You will almost never be able to exit the search because of the `c->distance > layer->max_distance` condition, if you define `max_distance` as "the max distance ever seen" instead of "max distance among current set W".
The search is much slower with this PR now:
```
postgres=# select id from items_small order by embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]' limit 1;
id
-------
27868
(1 row)
Time: 420.587 ms
postgres=# set hnsw.enable_iterator =off;
SET
Time: 0.328 ms
postgres=# select id from items_small order by embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]' limit 1;
id
-------
27868
(1 row)
Time: 3.622 ms
```
I think it's because of that issue with max_distance calculation, but I didn't verify it.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-29 19:09 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-29 19:09 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
(on src/hnswutils.c:624)
Yep...
Using max_distance was not good idea: it cause extraction of almost all elements in memory which leads to very bad performance and high memory consumption. So I have changed implementation to use distance to n-th element as criteria to stop recursive traversal. Now this time is almost the same as with original implementation.
To do it I have implemented function `pairingheap_nth`. It is very naive implementation: it just recursively call `pairingheap_delete_first` N times and then reconstruct the tree, adding removed elements back.
Maybe it is really better to maintain one more pairing heap, but I am not sure if it is better. At least approach with `pairingheap_nth` is much simpler.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-29 20:50 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-09-29 20:50 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
(on src/hnswutils.c:624)
Makes sense. I was working on a similar thing before I saw your update. See https://github.com/hlinnaka/pgvector/tree/hnsw_iterator. I took that other approach: I split W into three separate heaps: a min-heap and max-heap to maintain the top-ef elements, and a third heap to hold the rest of the elements. Yeah, `pairingheap_nth` is certainly simpler. Perhaps we should put those three heaps behind an abstraction, to make it look like one heap that provides a fast `peek nth element` operation.
Other changes:
- GetCandidate(): It kept the search going on all levels simultaneously, but I didn't understand how it works. The original algorithm walks down to the bottom level and forgets about the upper levels after that. I changed the iterator to do the same. It now uses HnswSearchLayer() for the upper levels like usual, and only uses the "continuous mode" on the bottom level.
- Added some comments to try to explain the continuous algorithm. Hope it helps.
What do you think?
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-30 04:54 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-30 04:54 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
(on src/hnswutils.c:624)
> I took that other approach: I split W into three separate heaps:
Yes, I also thought about it but considered that `pairingheap_nth` is more obvious approach is simpler to implement.
> GetCandidate(): It kept the search going on all levels simultaneously,
No, in my case it also performs search at one layer. It is `GetCandidate` which perform recursive traversal of all layers.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-30 05:17 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-30 05:17 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
(on src/hnswutils.c:624)
I have tested your version of OpenAI dataset. Results are mostly the same:
```
_id | dist
------------------------------------------------+--------------------
<dbpedia:Paris> | 0.5149979680215692
<dbpedia:Economy_of_Paris> | 0.5322160352313228
<dbpedia:List_of_tourist_attractions_in_Paris> | 0.5556925144520639
<dbpedia:Capitale-Nationale> | 0.560634247353793
<dbpedia:Besançon> | 0.5639481182838457
<dbpedia:Captal> | 0.5744128256080486
<dbpedia:Palais_de_Justice,_Paris> | 0.5744524110550726
<dbpedia:Laon> | 0.5754102943098868
<dbpedia:Hôtel_de_Ville,_Paris> | 0.5779674934070351
<dbpedia:Timeline_of_Paris> | 0.5780753294768416
(10 rows)
Time: 4.046 ms
```
A little bit slower than of original implementation (3.5 ms) but returning same top 10 documents).
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-30 09:57 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-09-30 09:57 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
I want to bring up this topic that I also wrote in a comment on my branch:
Currently on 'master', 'ef' parameter controls how many candidates to return. In the new continuous or iterator mode, 'ef' controls how many candidates to maintain in the pool at all times. For the same index and parameters, the first candidate to return is the same in both modes, but after that, the continuous mode can yield slightly different results. The results in continuous mode are always at least as good as in the one-shot mode, but because we "top up" the pool of candidates as we go, we might return elements that are closer to the query vector, after we have already returned some farther away elements.
In other words, in one-shot mode, we always return 'ef' elements in the right order, but because this is aNN, they are not necessarily the true nearest elements. In continuous mode, we return all elements if you keep iterating, but **they might not be in the right order**.
That can be surprising, but I think it's fine if you're just doing a simple aNN search. However, the planner doesn't know that the ordering is approximate. That can affect the rest of the plan, for example:
```
prepare surprise(vector) as
select a.id, b.id, a.embedding <=> $1
from items_small a, items_small b
where (a.embedding <=> $1) = (b.embedding <=> $1)
ORDER BY (a.embedding <=> $1)
limit 1000;
postgres=# execute surprise('[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]');
ERROR: mergejoin input data is out of order
```
The plan is:
```
postgres=# explain execute surprise('[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]');
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=65.20..89.29 rows=1000 width=16)
-> Merge Join (cost=65.20..424656.30 rows=17625172 width=16)
Merge Cond: ((a.embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]'::vector) = (b.embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]'::vector))
-> Index Scan using items_small_embedding_idx on items_small a (cost=32.60..13822.32 rows=59372 width=412)
Order By: (embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]'::vector)
-> Materialize (cost=32.60..13970.75 rows=59372 width=412)
-> Index Scan using items_small_embedding_idx on items_small b (cost=32.60..13822.32 rows=59372 width=412)
Order By: (embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]'::vector)
(8 rows)
```
I'm not sure what to think of this. The planner doesn't have a concept of an approximate sort order. Perhaps we could drop the information that a path is sorted after filtering has been done, but I'm afraid that would prevent the index scan from being chosen in a lot of scenarios that would be fine. The current situation, without this PR, where the index scan doesn't return all the rows in the table also violates the planner's assumptions, just differently, and it's perhaps less likely to throw errors :shrug:.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-09-30 11:51 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-09-30 11:51 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> I want to bring up this topic that I also wrote in a comment on my branch:
Another type of query which can suffer from order violation is group by:
```
explain select string_agg(_id,',') from (select _id,openai_vector <-> array[1,2,3]::vector as dist from documents order by dist limit 1000) group by dist;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------
GroupAggregate (cost=645.20..2711.52 rows=200 width=40)
Group Key: ((documents.openai_vector <-> '[1,2,3]'::vector))
-> Limit (cost=645.20..2704.02 rows=1000 width=37)
-> Index Scan using documents_openai_vector_idx on documents (cost=645.20..2059465.20 rows=1000000 width=37)
Order By: (openai_vector <-> '[1,2,3]'::vector)
(5 rows)
```
Frtankly speaking I do not have any good proposal of solving this problem. Both series seems to be very artificial and unlikely that any user will be faced with this problem. The concept of approximate search contradicts SQL standard fro the very begging: result of query plan using index may be different from query plan not using index. If we are not able to provide precise results, then order of this results seems to be less critical problem, doesn't it?
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-01 19:23 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-10-01 19:23 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> > I want to bring up this topic that I also wrote in a comment on my branch:
>
> Another type of query which can suffer from order violation is group by:
>
> ```
> explain select string_agg(_id,',') from (select _id,openai_vector <-> array[1,2,3]::vector as dist from documents order by dist limit 1000) group by dist;
> QUERY PLAN
> ------------------------------------------------------------------------------------------------------------------------
> GroupAggregate (cost=645.20..2711.52 rows=200 width=40)
> Group Key: ((documents.openai_vector <-> '[1,2,3]'::vector))
> -> Limit (cost=645.20..2704.02 rows=1000 width=37)
> -> Index Scan using documents_openai_vector_idx on documents (cost=645.20..2059465.20 rows=1000000 width=37)
> Order By: (openai_vector <-> '[1,2,3]'::vector)
> (5 rows)
> ```
>
> Frtankly speaking I do not have any good proposal of solving this problem. Both series seems to be very artificial and unlikely that any user will be faced with this problem. The concept of approximate search contradicts SQL standard fro the very begging: result of query plan using index may be different from query plan not using index. If we are not able to provide precise results, then order of this results seems to be less critical problem, doesn't it?
Yeah, equality on distance is a bit dubious. It's a float that gets rounded. That makes both my merge join and your group by example unrealistic.
A more realistic case would be MergeAppend, something like:
```
prepare mystmt(vector) as
(select id, embedding <=> $1 from items_small
union all
select id, embedding <=> $1 from items
)
order by 2;
postgres=# explain execute foo('[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]');
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Merge Append (cost=10000220245.31..10000249571.04 rows=1242881 width=12)
Sort Key: ((items_small.embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]'::vector))
-> Index Scan using items_small_embedding_idx on items_small (cost=32.60..13970.75 rows=59372 width=12)
Order By: (embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]'::vector)
-> Sort (cost=10000220212.70..10000223171.47 rows=1183509 width=12)
Sort Key: ((items.embedding <=> '[-0.31533,0.25417,0.55528,-0.29229,-0.0027537,-1.1689,0.17151,0.060029,0.62897,0.17066,-0.14748,-0.31574,1.0416,-0.017593,-0.053196,0.62312,0.6691,-0.77713,1.4983,0.28086,-0.62815,0.10885,0.74758,-0.24324,0.3955,0.55461,-0.052652,-0.18485,0.51246,0.19892,0.00013484,-0.25888,-0.11083,-0.063943,-0.71447,0.054546,0.96663,0.31343,-0.3033,1.0454,0.82853,0.34762,-0.17433,0.46479,4.1116e-05,0.11956,0.17235,-0.48861,-0.29915,0.7081,0.10253,-0.27391,-1.1292,-0.69647,-0.58459,0.13411,0.27188,-0.47946,0.093771,-0.69395,0.074337,0.20074,0.12972,0.51127,-0.013941,-0.22493,0.80425,0.87931,0.33713,0.22308,-0.62297,-0.4134,0.60944,0.0014924,0.3207,0.26836,0.3099,0.076108,-0.031559,-0.26954,-0.59395,0.098534,0.29471,-0.39031,0.12679,-0.42897,0.20498,-0.60429,-0.27911,-0.44967,0.34115,-0.24527,0.02525,0.54558,0.63618,0.38963,0.10122,0.81177,-0.15689,0.034974]'::vector))
-> Seq Scan on items (cost=10000000000.00..10000080601.86 rows=1183509 width=12)
JIT:
Functions: 6
Options: Inlining true, Optimization true, Expressions true, Deforming true
(10 rows)
```
That happens to work, though. MergeAppend doesn't do the same sanity check that MergeJoin does. So maybe we're all good; the rule would be that equality on distance is dubious, so if you try to do that, you might get errors. Other operations that depend on ordering work as much as you would expect, given that the ordering is approximate to begin with.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-02 05:05 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-10-02 05:05 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Yeah, equality on distance is a bit dubious.
Sure. Originally I tried `(dist * 100)::integer` which may have some sense but Postgres is not smart enough to understand that the order is preserved after such transformation and uses hash join in this case.
> That happens to work, though.
Sorry, but why `UNION ALL` and not `UNION`?
`UNION ALL` doesn't remove duplicates so for it order is not important.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-02 14:40 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2023-10-02 14:40 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
To address problem with order violation I have added `hnsw.strict_order` GUC.
When set, it just skips results which violates distance ascending order.
So will will get not all results, but order is not violated and no query execution can cause error.
By default it is switched off, because I see that cases where query order is important are quite exotic.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-05 12:26 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-10-05 12:26 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> > That happens to work, though.
>
> Sorry, but why `UNION ALL` and not `UNION`? `UNION ALL` doesn't remove duplicates so for it order is not important.
The query has an ORDER BY. The planner chooses to implement that with MergeAppend over already-sorted outputs from two branches of the UNION ALL.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-26 11:22 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-10-26 11:22 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane do you have any thoughts on this? In particular, what do you think of returning rows in "wrong" order vs omitting rows that would be in wrong order?
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-30 03:35 ` "ankane (@ankane)" <noreply+ankane@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: ankane (@ankane) @ 2023-10-30 03:35 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @knizhnik, thanks for the PR. It's an interesting approach, but want to explore potentially more efficient methods like [HQANN](https://arxiv.org/abs/2207.07940) for filtered search.
For returning results out-of-order: It's definitely not ideal, but will likely happen with scalar/product quantization as well (and will likely cause confusion since it's not intuitive). Ideally Postgres would have an option to re-rank results from the heap (that access methods / index scans could set), but as far as I know, there's not a way to currently do this.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-30 10:06 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: hlinnaka (@hlinnaka) @ 2023-10-30 10:06 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Hi @knizhnik, thanks for the PR. It's an interesting approach, but want to explore potentially more efficient methods like [HQANN](https://arxiv.org/abs/2207.07940) for filtered search.
HQANN is interesting. [Filtered-DiskANN](https://harsha-simhadri.org/pubs/Filtered-DiskANN23.pdf) is a similar paper but with more thorough experiments IMHO. It's based on Vamana but I think the results would be similar with HNSW.
A problem with that approach is that it's only applicable to equality quals (e.g. `col = 'foo'`). Those are common, but there's a long tail of other queries where it doesn't help. So if we can improve the post-filtering, that would still be useful even if we had HQANN.
> For returning results out-of-order: It's definitely not ideal, but will likely happen with scalar/product quantization as well (and will likely cause confusion since it's not intuitive). Ideally Postgres would have an option to re-rank results from the heap (that access methods / index scans could set), but as far as I know, there's not a way to currently do this.
Ok. Re-ranking could indeed reduce the confusion to applications. It wouldn't help within the executor though; even if you sort the final result set, the intermediate results would still be in wrong order, which can confuse e.g. merge joins or group by. You usually couldn't force re-sorting the intermediate results because you don't know beforehand how many tuples you need from the intermediate node. I think we need to either:
a) Accept weird results if the planner chooses a plan that depends on the ordering, like a merge join,
b) Omit the out-of-order results from the result set altogether, or
c) Introduce the concept of "approximate order" to the planner. If a result set is in approximate order, it's good enough to satisfy an ORDER BY requested by the user, but not for merge joins and such. (And optionally, we could re-sort the final result, if it's in approximate order)
I don't think this is a huge problem in practice. When someone is using a pgvector index, they've already accepted that the results are approximate. Nevertheless it would be nice to have a coherent story on what kind of errors can happen.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2023-10-30 21:13 ` "WillPowelson-at (@WillPowelson-at)" <noreply+WillPowelson-at@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: WillPowelson-at (@WillPowelson-at) @ 2023-10-30 21:13 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
FWIW, I'd like to voice support for this or any other addition that allows the combination of ANN with (mostly) arbitrary queries, would be useful to my company's use cases.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-09-22 19:45 ` "ankane (@ankane)" <noreply+ankane@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: ankane (@ankane) @ 2024-09-22 19:45 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @knizhnik, thanks again for the PR (and kicking off this discussion). Have been spending time on this area lately and think I've found an approach that works well with vacuuming (#678). Let me know if you have any thoughts.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-09-24 11:26 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2024-09-24 11:26 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Hi @knizhnik, thanks again for the PR (and kicking off this discussion). Have been spending time on this area lately and think I've found an approach that works well with vacuuming (#678). Let me know if you have any thoughts.
Hi
Do I correctly understand the the main idea of your approach is used batching for layer 0 to improve access locality?
But still I do not completely understand it's relation with vacuuming... When heap is updated, index bloating may take place, i.e. index will contain at lot of entries to dead tuples. It can cause problems with top-k search algorithm, because selected tuples may be rejected later by MVCC visibility. Certainly HNSW iterator can solve this problem. But I do not understand why your approach better deals with vacuuming.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-09-24 17:38 ` "ankane (@ankane)" <noreply+ankane@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: ankane (@ankane) @ 2024-09-24 17:38 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @knizhnik, two things that can happen with the approach in this PR related to vacuuming are:
1. An element can be replaced between reading the element tuple and reading the neighbor tuple, giving an incorrect list of neighbors.
2. When reading neighbors, one of the elements may be replaced between reading the neighbor tuple and reading the element tuple, giving an incorrect element.
#678 addresses this by:
1. Adding a version to each element
2. Using `HNSW_SCAN_LOCK` (which prevents both 1 and 2 in the non-iterative approach). This ensures vacuuming waits for current scan iterations to complete before marking elements as deleted (at which point an element can be immediately replaced). Iterations that start after vacuuming begins marking elements as deleted won't see any of those elements in neighbor tuples, avoiding this issue. Another approach (requiring a bit more space) would be to save the element version of each neighbor in the neighbor tuple.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-09-25 12:01 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2024-09-25 12:01 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Hi @knizhnik, two things that can happen with the approach in this PR related to vacuuming are:
>
> 1. An element can be replaced between reading the element tuple and reading the neighbor tuple, giving an incorrect list of neighbors.
> 2. When reading neighbors, one of the elements may be replaced between reading the neighbor tuple and reading the element tuple, giving an incorrect element.
>
> #678 addresses this by:
>
> 1. Adding a version to each element
> 2. Using `HNSW_SCAN_LOCK` (which prevents both 1 and 2 in the non-iterative approach). This ensures vacuuming waits for current scan iterations to complete before marking elements as deleted (at which point an element can be immediately replaced). Iterations that start after vacuuming begins marking elements as deleted won't see any of those elements in neighbor tuples, avoiding this issue. Another approach (requiring a bit more space) would be to save the element version of each neighbor in the neighbor tuple.
Thank you for clarification. But then I have few questions:
1. How element version can preserve consistency? Right now if you find element with unexpected version you just stop traversal. But it means that scan may return less results than expected, may not it?
2. Is it be possible to hold `HNSW_SCAN_LOCK` until the end of the scan and also obtain in in index append? In this case not concurrent modification of index are osible during scan and there is no need to track element's versions. Yes certainly in this case we can not perform concurrent updates and select from the index. But it is really critical? I think that in most HNSW use cases data is loaded and then is accessed by queries.
3. What will happen if some long query is not finished during 16 vacuum iterations? Very unlikely but...
4. Why versioning and locking is used only for vacuum and scan? Why for index inserts synchronisation is not needed?
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-09-26 13:23 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2024-09-26 13:23 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Few more questions:
1. Is there race condition between repairing graph in vacuum and scan? Scan is traversing graph, vacuum is reconstructing it. Yes, both are locking current buffer, but this lock lock is released before going to neighbours.
2. Can `HNSW_UPDATE_LOCK` prevent race condition between repairing graph in vacuum and appending elements to the graph (hnswinsert)? This lock is obtained by vacuum to wait completion of all active updates. But then it is immediately released. If some update is intiated right after releasing this lock?
3. How races between scan and append is avoided? Scan is not obtaining `HNSW_UPDATE_LOCK` either insert is not obtaining `HNSW_SCAN_LOCK`, so both ore holding lock only on current buffer which is released after building neighbours list.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-09-26 15:18 ` "ankane (@ankane)" <noreply+ankane@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: ankane (@ankane) @ 2024-09-26 15:18 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @knizhnik,
For the first set of questions:
1. Element versioning solves the first issue in my last comment
2. It's not possible to hold page locks for the duration of the scan for the iterative case (I believe there's an assertion that prevents it)
3. This would be extremely unlikely (the same element would also need to be deleted and replaced each time as well). That being said, I'll update the code so it doesn't crash if this ever happens. Edit: updated in 1a1221f9051f4bb266846ce6af30b3aa4a93300d
4. Inserts use `HNSW_UPDATE_LOCK` for synchronization.
For the second set of questions:
1. It's fine if neighbors are updated during a scan.
2. Yes, as the comment in the code states: "Inserts before this point may have neighbors about to be deleted. Inserts after this point will not."
3. There are no issues with scans and inserts since neither delete elements.
Check out the comments in the code around `HNSW_UPDATE_LOCK` and `HNSW_SCAN_LOCK` for how it all works together.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-09-27 06:07 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: knizhnik (@knizhnik) @ 2024-09-27 06:07 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
> Hi @knizhnik,
>
> For the first set of questions:
>
> 1. Element versioning solves the first issue in my last comment
> 2. It's not possible to hold page locks for the duration of the scan for the iterative case (I believe there's an assertion that prevents it)
> 3. This would be extremely unlikely (the same element would also need to be deleted and replaced each time as well). That being said, I'll update the code so it doesn't crash if this ever happens. Edit: updated in [1a1221f](https://github.com/pgvector/pgvector/commit/1a1221f9051f4bb266846ce6af30b3aa4a93300d)
> 4. Inserts use `HNSW_UPDATE_LOCK` for synchronization.
>
> For the second set of questions:
>
> 1. It's fine if neighbors are updated during a scan.
> 2. Yes, as the comment in the code states: "Inserts before this point may have neighbors about to be deleted. Inserts after this point will not."
> 3. There are no issues with scans and inserts since neither delete elements.
>
> Check out the comments in the code around `HNSW_UPDATE_LOCK` and `HNSW_SCAN_LOCK` for how it all works together.
O, I see...
Thank you very much for explanation.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-10-30 22:32 ` "ankane (@ankane)" <noreply+ankane@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: ankane (@ankane) @ 2024-10-30 22:32 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane closed this.
^ permalink raw [nested|flat] 33+ messages in thread
* Re: [pgvector/pgvector] PR #282: Hnsw iterator
@ 2024-10-30 22:32 ` "ankane (@ankane)" <noreply+ankane@github.com>
31 siblings, 0 replies; 33+ messages in thread
From: ankane (@ankane) @ 2024-10-30 22:32 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
0.8.0 is now released, so closing this out.
Big thanks @knizhnik and @hlinnaka, and sorry this took so long to resolve.
^ permalink raw [nested|flat] 33+ messages in thread
end of thread, other threads:[~2024-10-30 22:32 UTC | newest]
Thread overview: 33+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-09-27 06:33 [pgvector/pgvector] PR #282: Hnsw iterator "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-27 21:00 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2023-09-27 21:03 ` "jkatz (@jkatz)" <noreply+jkatz@github.com>
2023-09-28 15:52 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-28 15:56 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-28 16:22 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-09-28 18:24 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-29 09:33 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-09-29 14:05 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-29 16:00 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-09-29 19:09 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-29 20:50 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-09-30 04:54 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-30 05:17 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-09-30 09:57 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-09-30 11:51 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-10-01 19:23 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-10-02 05:05 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-10-02 14:40 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2023-10-05 12:26 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-10-26 11:22 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-10-30 03:35 ` "ankane (@ankane)" <noreply+ankane@github.com>
2023-10-30 10:06 ` "hlinnaka (@hlinnaka)" <noreply+hlinnaka@github.com>
2023-10-30 21:13 ` "WillPowelson-at (@WillPowelson-at)" <noreply+WillPowelson-at@github.com>
2024-09-22 19:45 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-09-24 11:26 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2024-09-24 17:38 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-09-25 12:01 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2024-09-26 13:23 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2024-09-26 15:18 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-09-27 06:07 ` "knizhnik (@knizhnik)" <noreply+knizhnik@github.com>
2024-10-30 22:32 ` "ankane (@ankane)" <noreply+ankane@github.com>
2024-10-30 22:32 ` "ankane (@ankane)" <noreply+ankane@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox