* use mmap bitslice and a metadata file to avoid loading
* fix and test reported files
* add new files to flusher
* update rocksdb+blob_store compatibility test
* switch to DynamicMmapFlags
* fix setting deleted to `false` on short bitslice
* remove `MmapBitSlice::extend`
* add some more tests to mmap sparse vector storage
* calculate deleted_count and next_point_offset on load
* get rid of metadata file
* cleanup
* fix test
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* implement mmap sparse vector storage
* add to VectorStorageEnum
* clippy
* add tests, fix both simple and mmap storages
* smol correction on total_vector_count
* add sparse storage type to config
* fix reading config without storage type
* generate openapi
* use blob_store by path
* hidden setting to enable new storage
* validate existing path in `BlobStore::open()`
* use new dir for each sparse vector name
* fix and rename `max_point_offset`
Plus some extra refactors
* add storage compat test, to always check both storages work
* fix opening of storage + other misc fixes
* FIX!!!
`Unset` operations in the Tracker weren't updating the
`next_pointer_id`. So, when reopening the storage, those points wouldn't
get marked as deleted in the bitslice, thus creating the illusion that
they should exist, when they did not.
* refactor naming from `iter_*` to `for_each_*`
* fix checking for BlobStore existance
* fix typo
* fix error message
* better docs for open_or_create
* fix after rebase
This uses `TempDir` and comes with its caveats, e.g. the temporary segment
directory will not be deleted if the process exits. This should not be a
problem in practice, as all temporary segments get deleted when the shard is
loaded (see PR #2319).
Fixes#2978.
* move FacetIndex into facet_index.rs
* add support for integer facets
* add support for uuid facets
* use separate internal structure
* rename FacetValue::Keyword into FacetValue::String in REST
* fix after rebase
* Don't use ID but current point offset when optimizing dense mmap storage
This change now matches the implementation in all other storage types.
* Remove now obsolete point offsets in update_from point iterator
* Fix test
* Migrate uuid index to mmap
* add uuid numeric index
* select correct index + tenants
* Only serialize if necessary
* select correct index
* reset Cargo.toml
* review: use only map index for uuid for now
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* add force_ram parameter to chuncked mmap vector storage
* enable mlocked mmap vector storage on unix by default
* regen openapi
* add mlock on creation of chunck
* minor unrelated renaming
* rollback changes in LockedChunkedMmap
* fmt
* make AppendableMmapDenseVectorStorage generic of storage type
* make AppendableMmapMultiDenseVectorStorage generic of storage type
* implement initialization of InRamChunkedMmap
* implement MultiDenseAppendableInRam and variations
* enable InRamChunkedMmap for multivectors
* use same CHUNK_SIZE for mmap and regular chuncked vectors
* enable InRamChunkedMmap by default
* fix tests
* rollback usage of InRamChunkedMmap by default
* review changes
* add assertion on chunk_capacity [skip-ci]
* refactor: let SegmentBuilder::update take unlocked segments
* style: split long lines
* refactor: introduce TestSegments
* test: add tests for mmap indices
* define mmap map index
add point to values
add mmap hash map
are you happy fmt
use new mmap hashmap methods
build index
saturating_sub
are you happy clippy
fix tests build
* integrate facets for mmap index
* mmap tests
* fix ci
* review remarks
* review remarks
* add UuidIndex
* fix clippy
* rebase to dev
* update api docs
* don't use wrapper type for Uuid index
* rebase to `dev`
* remove existence checking
* rename UuidPayloadKeyType => UuidIntType
* apply review changes
* rebase to dev
* post-rebase fixes
* Improve estimation
* Improve naming
* Apply suggestions from code review
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
* use u128 in histogram and improve uuid sorting
* Also allow defragmentation for completely random Uuids
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* sorting
* migrate tests and move logic into SegmentBuilder
* add test and improve implementation
* improve code
* review
* code review improvements
* add index building to test
* Do not clone ranges
* Resolve clippy warnings due to recent PR on dev
* review suggestions
* Defragmentation in api (#4684)
* add tenant config to api
* deduplicate used defragmentation keys
* rename is_tenant to is_primary
* use all values to defrag key
* rename is_primary -> is_tenant
* update schema
---------
Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: timvisee <tim@visee.me>
* add immutable_id_tracker
* add dirty flag in test
* don't use immutable_id_tracker for now
* improve and integrate new immutable_id_tracker
* split external_to_internal into two BTreeMaps
* apply rquested changes
* delay mmap writes until flush
* remove unnecessary clone
* single source of truth for file path
* use custom de/serialization for more performance
* disable id tracker and fix codespell
* improve code & test
* Other minor nitpicks
* Apply suggestions from code review
* fix rebase issues
* basic custom mappings storage implementation
* add tests & fix bugs
* add more tests and fix bugs
* undo .codespellrc
* disable immutable_id_tracker completely for now
* fix clippy
* Remove unnecessary pub
* minor renaming
* Move build_index out of VectorIndex
* Build index in HNSWIndex::open()
* Introduce HnswIndexOpenArgs
* Proper deletion
* Improve tests
* HNSW::open(): add warn, comment and assert
* Revert to making up the config if it does not exist
* Rename InvertedIndex* -> InvertedIndexCompressed*
* Extract method VectorIndexEnum::fill_idf_statistics
* Extend VectorIndexEnum with new variants
* Introduce sparse::InvertedIndex::Version
* Replace SparseVectorIndexVersion -> InvertedIndex::Version
* Introduce sparse_vector_index::OpenArgs
* SparseVectorIndex::open: do not build index if directory is empty
Otherwise it would build the index twice since `SegmentBuilder::build()`
calls `::open()`, then `::build_index()`. This restores the old (<=v1.9)
behavior.
* Renames
* fix hnsw full scan threshold
* add test
* are you happy clippy
* separate open_vector_storage
* remove public fields from builder
* wip: do not create segment in builder before build
* avoid arc in storage test and low-level loading functions
* WIP: remove internal segment from SegmentBuilder
* fmt
* finalize segment builder fixes
* Revert "are you happy clippy"
This reverts commit c04afa6989.
* Revert "add test"
This reverts commit 8e7ad6207e.
* Revert "fix hnsw full scan threshold"
This reverts commit 8904443fcb.
* remove _daatabse from builder
* fix optimizer test
* fix id tracker versions persistence
* do flush for segment components on build
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* Put temporary segment in correct path
* Use shard directory rather than collection directory in test
* Fix collection path getter, it actually returns segments path
* Use segments path for temporary segment
* The build segment function actually wants the segments path
* Refactor parameter name
* Allow multivec search on legacy REST API
* show that it works for gRPC as well
* better error message
* update error assertion
* show validation on REST as well
* remove unecessary test
* fix conversion - dim is not vec count
* fmt
* Use TypedMultiDenseVectorRef everywhere (#4224)
* Use TypedMultiDenseVectorRef everywhere
* remove obsolete test
* fix codespell
* fix build
* test single dense vector expansion on upsert
---------
Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
* Add dynamic mmap flags function to count flags
* Remove stopped flag
* Add test for new count function to check correctness
* Add benchmark for flag count function
* Fix clippy warning
* Rename bench from deleted to flag count
* Fix typo
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
* Construct stoppable flag outside bench, add non-stoppable bench
---------
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
* byte storage with quantization
raw scorer integration
config and test
are you happy fmt
fn renamings
cow refactor
use quantization branch
quantization update
* are you happy clippy
* don't use distance in quantized scorers
* fix build
* add fn quantization_preprocess
* apply preprocessing for only cosine float metric
* fix sparse vectors tests
* update openapi
* more complicated integration test
* update openapi comment
* mmap byte storages support
* fix async test
* move .unwrap closer to the actual check of the vector presence
* fmt
* remove distance similarity function
* avoid copying data while working with cow
---------
Co-authored-by: generall <andrey@vasnetsov.com>
* Integrate Multivector at segment level
* more tests - green with lower accuracy
* decrease expected accuracy to fix test
* cleanup test
* multivector can not be empty
* vary number of vector per multivec point
* Multivec knob for SegmentConfig
* regen openapi
* add TODO for next step
* introduce multivecconfig to support more similarity aggregation
* update openapi