Andrew Kane
264494b3e2
Added halfvec type
2024-03-27 13:47:19 -07:00
Andrew Kane
91e3d2905f
Fixed sort function for Postgres 12
2024-02-28 16:26:41 -08:00
Andrew Kane
fe2406564f
Replaced pairing heap with array in SelectNeighbors - closes #447
...
Co-authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi >
2024-02-28 15:47:26 -08:00
Andrew Kane
efed873a3e
Revert "Replaced pairing heap with array in SelectNeighbors - closes #447 "
...
This reverts commit 14b278dec9 .
2024-02-28 11:33:14 -08:00
Andrew Kane
14b278dec9
Replaced pairing heap with array in SelectNeighbors - closes #447
...
Co-authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi >
2024-02-28 11:25:12 -08:00
Andrew Kane
ca10cbaa7d
Revert "Remove offsethash"
...
This reverts commit 1cbd204f52 .
2024-02-20 16:07:32 -08:00
Andrew Kane
eb29019a14
Revert "Eliminate a few HnswPtrAccess invocations"
...
This reverts commit 334c386a45 .
2024-02-20 16:07:21 -08:00
Heikki Linnakangas
334c386a45
Eliminate a few HnswPtrAccess invocations
...
HnswPtrAccess() is pretty cheap, but it stills seems worthwhile to
avoid repeated calls in the hot paths when it can be easily avoided.
2024-02-19 14:13:18 +02:00
Heikki Linnakangas
1cbd204f52
Remove offsethash
...
The original motivation was to eliminate the superfluous HnswPtrAccess
call from AddToVisited. The caller has to call HnswPtrAccess() anyway,
so it makes sense to pass the HnswElement rather than HnswElementPtr
to AddToVisited(). But then I realized that we can use the
pointer-variant even with shared memory, because the visited-hash is
backend-private, and the addresses where the elements are mapped to in
shared memory are stable within the backend.
2024-02-19 14:12:26 +02:00
Andrew Kane
ba2776850b
Fixed Valgrind check for HNSW in-memory, parallel index builds - closes #441
2024-01-28 16:19:32 -08:00
Andrew Kane
0cc883b944
Removed checking neighbors for cached distance
2024-01-28 02:11:24 -08:00
Andrew Kane
705e71015f
Fixed uninitialized entry point level - fixes #439 and closes #440
2024-01-27 19:49:40 -08:00
Andrew Kane
f7eda7bd20
DRY neighbor array size [skip ci]
2024-01-24 17:54:33 -08:00
Andrew Kane
2260e13315
Condensed code [skip ci]
2024-01-24 16:20:00 -08:00
Andrew Kane
90e0a14bda
Moved allocating neighbor array to separate function [skip ci]
2024-01-24 16:17:34 -08:00
Heikki Linnakangas
c8be3a369b
Include generic_xlog.h directly in the .c files where it's needed
...
There are no references to anything that's in generic_xlog.h in the
header files.
2024-01-23 13:04:03 +02:00
Heikki Linnakangas
f31d708c2b
Add direct include to pairingheap.h in headers
...
ivfflat.h and hnsw.h have references to pairingheap_node, so they need
to include lib/pairingheap.h. It happened to work, because
lib/pairingheap.h was being included indirectly through
nodes/execnodes.h, but let's be explicit.
Remove the include from hnswbuild.c, because there are no calls to
pairingheap functions in that file. Instead, add the includes to
hnswutils.c and ivfscan.c, which do have such calls. They are not
strictly necessary again because of the indirect include from hnsw.h
and ivfflat.h, but let's be explicit while we're messing with this.
2024-01-23 12:53:22 +02:00
Andrew Kane
a1e526ef82
Dropped support for Postgres 11
2024-01-22 23:52:54 -08:00
Andrew Kane
2d0f162bd7
Added support for in-memory parallel index builds for HNSW
...
Co-authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi >
2024-01-22 23:19:10 -08:00
Andrew Kane
44b90be452
Made variable name consistent across functions [skip ci]
2024-01-22 19:02:33 -08:00
Andrew Kane
31572a7b28
Removed unused parameter [skip ci]
2024-01-22 19:00:45 -08:00
Andrew Kane
2427290ea9
Pass hash by reference
2024-01-22 18:34:40 -08:00
Andrew Kane
597bfdc76b
Added HnswGetNeighbors macro
2024-01-13 20:00:34 -08:00
Andrew Kane
cbf3eb4fa5
Improved HNSW build and insert code
2024-01-13 10:07:42 -08:00
Andrew Kane
108fb09d7b
Improved code [skip ci]
2024-01-08 17:54:49 -08:00
Andrew Kane
8ee37b60a0
Improved memory estimate for HNSW index builds
2024-01-03 13:47:50 -05:00
Andrew Kane
9b73b3d1a6
Reduced memory and allocations for heap TIDs - closes #385
2024-01-03 13:41:34 -05:00
Andrew Kane
ec41dfa1d7
Mark meta buffer contents as dirty when not logging
2023-12-20 16:20:15 -05:00
Andrew Kane
e88a425c9b
Reduced WAL generation for HNSW index builds - thanks @hlinnaka
2023-12-19 20:37:32 -05:00
Andrew Kane
921427ee03
Replace dynahash hash table in HNSW with simplehash for speed - #378
...
Co-authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi >
2023-12-17 11:24:13 -05:00
Japin Li
4549e8aeb1
Fix coredump about HnswFreeElement() ( #357 )
...
The HnswInitElement() allocate an element with not initialize value
filed, which may has garbage that lead HnswFreeElement() free an
invalid pointer.
2023-11-15 16:19:59 -08:00
Andrew Kane
3263b350f5
Updated HnswLoadElementFromTuple to be less vector-specific
2023-11-11 21:14:12 -08:00
Andrew Kane
69a2ce0d43
Use datumIsEqual to compare
2023-11-10 10:46:48 -08:00
Andrew Kane
d078db3d25
Switched HnswElementTuple to generic data and zero full section
2023-11-09 18:28:25 -08:00
Andrew Kane
fbb904ae2f
Use pointer for VARSIZE_ANY
2023-11-09 17:50:28 -08:00
Andrew Kane
3cf6f62900
Switched to datum for HnswElement
2023-11-09 17:35:39 -08:00
Andrew Kane
2a69e22ca4
Switched from VECTOR_SIZE to VARSIZE_ANY where possible (less vector-specific)
2023-11-09 17:16:43 -08:00
Andrew Kane
4b5db94307
Disable closer caching for new elements for now
2023-10-06 14:27:09 -07:00
Andrew Kane
65e70326b8
Updated comment [skip ci]
2023-10-06 14:07:35 -07:00
Andrew Kane
71641ed84e
Updated comment [skip ci]
2023-10-06 13:58:07 -07:00
Andrew Kane
f3dba25036
Added comment [skip ci]
2023-10-06 13:56:25 -07:00
Andrew Kane
5588ba6410
Improved variable name [skip ci]
2023-10-06 13:46:19 -07:00
Andrew Kane
ec9fac5456
Improved closerSet logic
2023-10-06 13:39:55 -07:00
Andrew Kane
8085d3e538
Moved sorting logic into SelectNeighbors
2023-10-06 12:56:15 -07:00
Andrew Kane
cae162ffc6
Ensure order is deterministic for SelectNeighbors closer caching
2023-10-06 12:26:53 -07:00
Andrew Kane
62482e3760
Use e for consistency
2023-10-05 16:15:13 -07:00
Heikki Linnakangas
c81302b835
Improve HNSW index build performance more ( #295 )
...
This takes the approach from commit a713e2acaa further. Once we have
remove a candidate from the "closer" set, we still don't need to
recalculate everything that follows. Any candidates that were in the
closer set before still only need to be compared with any new
candidates that we have added.
2023-10-05 16:04:50 -07:00
Andrew Kane
a713e2acaa
Improved performance of HNSW index builds - closes #292
...
Co-authored-by: Heikki Linnakangas <heikki.linnakangas@iki.fi >
2023-10-05 13:21:26 -07:00
jeff-davis
b247b688a8
No need to MarkBufferDirty(); GenericXLogFinish() does that. ( #265 )
2023-09-15 13:14:10 -07:00
Andrew Kane
9672446a4c
Updated order [skip ci]
2023-09-12 19:53:12 -07:00