Commit Graph

1438 Commits

Author SHA1 Message Date
Tim Visée
705607fe9c Add mutable map payload index on top of Gridstore (#6634)
* Serialize vector of ecow strings using cbor

* Adjust trait bounds for Gridstore support in map index

* Add Gridstore backend to mutable map index

* Add Gridstore builder

* Enable new map index in index selector

* Add tests

* Use different Gridstore block size depending on map data type

* Fix review remarks
2025-07-17 11:36:19 +02:00
Tim Visée
3fc861976d Add mutable numeric payload index on top of Gridstore (#6609)
* Extend Gridstore blob trait, support basic primitives and vector of them

* Implement mutable numeric index on top of Gridstore

* Wrap Gridstore in rwlock, flush asynchronously

* Set custom Gridstore options tuned to numeric index

* Fix compilation errors

* Destruct RocksDB selector everywhere

* Add Gridstore payload index selector, build numeric, fallback others

* Add feature flag to Gridstore mutable payload index

* Don't store empty values in gridstore, it's not supported

* Reformat

* Initialize Gridstore during init of index builder

* Use owned and referenced paths correctly around Gridstore

* Change Gridstore page size in numeric index as suggested

* Make Gridstore block size dependent on size of numeric type

* Add tests

* Add separate fixed size blob trait for vec, prevent footgun

* Improve page size calculation

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* Simplify Blob requirement for numeric payload index

* Add missing test cases

* Replace ref mut with &mut

* Use correct hardware counter

* Implement clear cache for numeric payload index on Gridstore

* The block size is dynamic

* Error if trying to load index from storage that doesn't match backend

* fix counter

* Add comment on why we change page size

---------

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-07-17 11:36:11 +02:00
Ivan Pleshkov
7c44207ac1 reduce gpu vector storage tests amount (#6621) 2025-07-17 11:35:56 +02:00
Jojii
de030bae5b Remove option from immutable_inverted_index (#6636) 2025-07-17 11:23:42 +02:00
Tim Visée
d9a36cdd0a Migrate away from RocksDB based dense vector storage (#6603)
* Add function to open all appendable dense vector storage types

* Add function to find appendable dense storage files without opening it

* Add function to migrate RocksDB dense vector storage into mmap

* Add feature flag and actively migrate on load

* Log number of migrated points

* Add function to open all simple dense vector storage types

* Add test for simple dense vector storage migration

* Use correct column families

* Use more generic feature flag

* Also migrate vector deletes

* Fix review remarks
2025-07-17 11:23:24 +02:00
Andrey Vasnetsov
52ca4fffc5 Merge pull request #6479
* refactor build_filtered_graph

* utils

* fmt

* implement connectivity estimation

* Improve connectivity check in HNSW index (#6571)

* Use BitVec::fill instead of our custom function
2025-07-17 11:22:33 +02:00
Andrey Vasnetsov
3f6c909057 Fix default replication factor (#6632) 2025-07-17 11:22:12 +02:00
Luis Cossío
68bc532daf [phrase match] Mmap full text index for phrase (#6602)
* enumify `.positions` field in immutable and mmap inverted index

* review fixes
2025-07-17 11:13:44 +02:00
Luis Cossío
77114e2198 [phrase match] Generic mmap postings (#6619)
* generic MmapPostings<V>

impl MmapPostingValue for Positions

* simplify associated types
2025-07-17 11:13:38 +02:00
dependabot[bot]
d68fb35b21 build(deps): bump macro_rules_attribute from 0.2.0 to 0.2.2 (#6631)
Bumps [macro_rules_attribute](https://github.com/danielhenrymantilla/macro_rules_attribute-rs) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/danielhenrymantilla/macro_rules_attribute-rs/releases)
- [Commits](https://github.com/danielhenrymantilla/macro_rules_attribute-rs/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: macro_rules_attribute
  dependency-version: 0.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-17 11:13:18 +02:00
Luis Cossío
30ad86da73 [phrase match] ParsedQuery as enum (#6617)
* parsed query now specifies intersection match

* use tokenset in parsed query

* review nits
2025-07-17 11:12:42 +02:00
Luis Cossío
e1f470ac7e [phrase match] Introduce ordered document (#6486)
* rename `Document`->`TokenSet`

* add point_to_doc to mutable text index

introduce point_to_doc

add TODO for using the new field

handle removals

* remove ser/de from `TokenSet`

* clippy

* review fixes
2025-07-17 11:12:29 +02:00
Tim Visée
08194f9b66 Improve Gridstore wipe/clear functionality (#6614)
* Gridstore config can be Copy

* Add test asserting wipe behavior

* Add clear function to Gridstore

* Make wipe take ownership, use new clear function everywhere

* Add comment to emphasize wipe behavior

* Propagate errors
2025-07-17 11:08:54 +02:00
Luis Cossío
1d0d6fc429 measure hardware in generic posting list (#6583) 2025-07-17 11:08:05 +02:00
Luis Cossío
3942071b9f Full text index with generic posting list (#6565)
* integrate generic posting list in full-text index

* improve intersection fn

improve iterator intersection

* make old module just for test

* recover old implementation of MmapPostings for tests

* add compatibility test

* fix compression

* clippy

* nits

* check if first id is already greater

protects against the case where the iterator's current element hasn't
been extracted yet

* update current element when there is no greater or equal

* reuse visitor in test

* optimize alignment

* bound checks and refactor is_in_range

* review

* edit comment

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-17 11:07:57 +02:00
Tim Visée
d09682886a Actively migrate away from RocksDB based ID tracker (#6579)
* Actively migrate RocksDB ID tracker to new format on segment load

* Extract ID tracker migration logic to function

* Feature flag ID tracker migration

* Simplify ID tracker migration by moving it deeper into load function

* Move migrate function to the bottom

* Add test to assert RocksDB to mutable ID tracker migration

* Assert new mutable ID tracker is empty

* Review remarks

* On RocksDB to mutable ID tracker migration failure, clean up files

* Demote empty mutable ID tracker to debug assertion

* Copy all point versions, including deleted, set known mappings

* read links and versions separatelly

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-17 11:04:38 +02:00
Andrey Vasnetsov
9054a872ac use id-tracker to estimate internal points range (#6593) 2025-07-17 11:02:39 +02:00
xzfc
8e4fc674d4 Invert feature_flags.hnsw_healing (#6589) 2025-05-23 11:40:19 +02:00
Arnaud Gourlay
dd97253fe9 Strict mode allows fullscan for multitenant payload index (#6498)
* Strict mode allows fullscan for multitenant payload index

* different error for missing payload index in multitenant case

* handle payload_m

* add simple test

* handle hnsw.m not set

* add another simple test

* fix test

* fallback to global HSNW config

* new error status code

* do not block on global HNSW and improver error reporting

* clearer error reporting

* review fixes

* fix test error messages

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 23:26:16 +02:00
Tim Visée
dd1ed15c37 Add RocksDB feature flag to ID trackers (#6572)
* Move point ID conversions

* Extract segment ID tracker creation into function

* Feature flag RocksDB based ID tracker
2025-05-22 23:25:31 +02:00
Tim Visée
a8ead042d7 Add RocksDB feature flag to vector storage (#6566)
* Add no-rocksdb feature flag, disable dense vector storage using RocksDB

* Disable multi dense vector storage using RocksDB

* Feature flag now unused function arguments

* Invert no-rocksdb, use rocksdb and enable by default

* RocksDB is required in some benches

* Feature flag RocksDB based sparse vector storage

* Propagate rocksdb feature flag to root crate

* Feature flag stored point, only used in context of RocksDB

* Mention what disabling RocksDB feature does in Cargo.toml
2025-05-22 23:25:15 +02:00
Tim Visée
7c23251bea Add volatile sparse vector storage (#6569)
* Add volatile sparse vector storage

* Add and use volatile sparse vector test

* Update OpenAPI spec

* Resolve review remarks
2025-05-22 23:25:05 +02:00
Tim Visée
8fe9b2d071 Add volatile multi dense vector storage (#6564)
* Add volatile multi dense vector storage

* Add and use volatile multi dense vector storage test
2025-05-22 23:24:40 +02:00
Tim Visée
6010fff4de Add volatile dense vector storage, use in tests (#6561)
* Add volatile dense vector storage

* Use volatile dense vector storage in tests

* Fix compilation error in GPU module

* Simplify constructor

* Use volatile storage in more tests
2025-05-22 23:24:34 +02:00
Arnaud Gourlay
252667e25c Update Criterion 0.6 (#6570) 2025-05-22 23:24:27 +02:00
Tim Visée
b4bf23ae51 Bump MSRV to 1.87 (#6558)
* Bump MSRV to 1.87

* Resolve TODOs
2025-05-22 23:19:48 +02:00
dependabot[bot]
f862d68e06 build(deps): bump io-uring from 0.7.6 to 0.7.7 (#6552)
Bumps [io-uring](https://github.com/tokio-rs/io-uring) from 0.7.6 to 0.7.7.
- [Commits](https://github.com/tokio-rs/io-uring/commits)

---
updated-dependencies:
- dependency-name: io-uring
  dependency-version: 0.7.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 23:19:16 +02:00
xzfc
08b343e0ab HNSW healing (#6543)
* Let SearchContext::new create empty context

* FixedLengthPriorityQueue: add `is_full()`

* Implement HNSW healing

* Apply review suggestions

* review comments and docstrcigs

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 23:18:32 +02:00
Tim Visée
c9fe4345cf Add full text payload index congruence test (#6546)
* Add congruence test for full text payload index

* Report what index variants we're testing

* Use string references

* deterministic keywords

* linting

* Use truncate instead of drain

* Don't check cardinality on deletion, indices behave differently

* Include index type in iterator

* Fix test compilation

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-05-22 23:18:27 +02:00
xzfc
d70a8d8157 Remove some generics from scorer (#6544)
* Make TInputQuery constructor parameter, not struct parameter

* VectorElementType could be implicit
2025-05-22 23:18:15 +02:00
Arnaud Gourlay
56f170f1f1 Fix unecessary unsafe in Clippy 1.87 (#6540)
* Fix unecessary unsafe in Clippy 1.87

* bump Rust version for intrinsics safe API

* ignore until we can bump the MSRV with cargo-chef

* remove unecessary change

* mark clearly as TODO
2025-05-22 23:17:51 +02:00
Luis Cossío
8c2b40bf00 Use null index more (#6504)
* take max_point_offset into consideration

* add null index even if index selector is for rocksdb

* fmt

* better cardinality estimation, check deleted inside filtered iter

* fix count indexed points, add primary conditions to estimator

* use len for count_indexed_points, adjust test

* remove deleted check from filtered iter

* cleaner removal
2025-05-22 23:13:40 +02:00
Jojii
0d2c1ce254 Make gridstore Advise::Random and add function for sequential read (#6510)
* Make gridstore Advise::Random and add function for sequential read

* Reduce duplicate code in gridstore

* use sequential implementation in iterator

* actually use the sequential read

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-05-22 23:12:43 +02:00
Tim Visée
d2a5dd1504 Fix immutable mmap index files not included in snapshot (#6535)
* Fix immutable text index not listing files for snapshot

* Other tweaks
2025-05-22 23:12:34 +02:00
Tim Visée
b6c416ca2e Merge pull request #6503
* Add storage enum to geo index

* Construct immutable geo index from mmap geo index

* Load immutable geo index from mmap storage if on-disk is false

* When immutable geo index is loaded into memory, clear mmap cache

* Adjust immutable geo index from mmap loading, consider point deletions

* Rename get_db_wrapper to db_wrapper

* Add immutable mmap geo index test, currently still failing

* Properly load geo index

* Add congruence test

* Also test with deletions

* Fix clipping warnings
2025-05-22 23:11:55 +02:00
dependabot[bot]
a6d5e9720a build(deps): bump tempfile from 3.19.1 to 3.20.0 (#6523)
* build(deps): bump tempfile from 3.19.1 to 3.20.0

Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.19.1 to 3.20.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.19.1...v3.20.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Use keep now as into_path is deprecated

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2025-05-22 23:10:59 +02:00
Arnaud Gourlay
570597ee32 Fix Clippy 1.87 bis (#6518) 2025-05-22 23:10:13 +02:00
Tim Visée
6bf59ed6eb Use more write buffers, and flush them (#6514)
* Explicitly flush buffered writers so that we catch errors

* Buffer IO in more places

* Tweaks

* Apply review suggestions
2025-05-22 23:10:07 +02:00
Arnaud Gourlay
749b2a3a0f Clippy 1.87 autofix (#6516)
* Clippy 1.87 autofix

* fmt
2025-05-22 23:09:57 +02:00
Tim Visée
f6214c28dd Add in-memory payload index on mmap storage (full text) (#6495)
* Add storage enum to full text index

* Add compressed mmap posting list iterator

* Don't check second condition and return early if possible

* Use helper function for creating empty iterator

* Construct immutable inverted index from mmap inverted index

* Construct immutable text index from mmap text index

* Load immutable text index from mmap storage if on-disk is false

* Match implementation for mutable to immutable inverted index, drop empty

* Point tokens should be none if empty

* Fix chunk reader iterator not buffering remaining postings correctly

* Add immutable mmap full text index to congruence test

* Debug assert deleted points have no tokens

* Add another test

* Fix point deletion regression in immutable full text index

* Use consistent function naming

* Restructure full text index opening and loading, make it consistent

* When immutable full text index is loaded into memory, clear mmap cache

* Remove init from immutable text index

* Prevent potential panic

* avoid panic

* Fix custom iterator size reporting, add test for it

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 23:09:18 +02:00
xzfc
07fbab30fa Heuristic optimization (#6501)
* Refactor out LinksContainer

This commit extracts Vec<PointOffsetType> and heuristic related
functions from graph_layers_builder.rs into a new file.

No significant changes in logic are made.

* Optimize LinksContainer

* Add illustration

* Fixups

* Add more comments and rename `score` to `cached_score`
2025-05-22 23:08:27 +02:00
Andrey Vasnetsov
2fe62d4b7e Batched reader for segment construction (#6487)
* naive implementation of batched reader for segment construction

* Make reads sequential in BatchedVectorReader (#6508)

* Add sequential reads and improve BatchedVectorReader

* implement get_many_sequential

---------

Co-authored-by: generall <andrey@vasnetsov.com>

* implement get_many_sequential

---------

Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
2025-05-22 23:07:39 +02:00
Tim Visée
cad4ceed4b Buffer all file IO when used as reader or writer (#6513) 2025-05-22 23:06:03 +02:00
Tim Visée
5774255345 Add in-memory payload indices on mmap storage (numeric, map) (#6444)
* Add RAM wrapper to mmap numeric index

* Add RAM wrapper to mmap map index

* Fix test compilation

* Merge RAM wrappers into existing immutable indices

Do this to minimize code duplication since the majority of the code is
exactly the same.

* Minor tweaks

* Remove unnecessary pub visibility, remove unused assertion

* Test immutable numeric index on mmap

* In numeric index test, remove some points

* Add map index test

* Restructure index opening and loading, make it consistent

* don't pre-collect intermediate mapping

* review nits

* Make init unreachable for immutable and mmap, clear must consume index

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-05-22 23:01:25 +02:00
Luis Cossío
c29479cac7 Deterministic HNSW builder (#6477)
* pass a RNG to hnsw index building

* use single-threaded build for accuracy-measuring tests

* clippy
2025-05-22 23:00:58 +02:00
Arnaud Gourlay
eaaa4e4ee1 Validate IntegerIndexParams (#6494)
* Validate IntegerIndexParams

* focus
2025-05-22 23:00:52 +02:00
dependabot[bot]
e82b9333ec build(deps): bump io-uring from 0.7.5 to 0.7.6 (#6492) 2025-05-22 22:59:21 +02:00
Ivan Pleshkov
32fbc2eae2 Don't reallocate gpu resources between payload blocks (#6462)
* dont reallocate gpu resources between payload blocks

* are you happy codespell

* fix review remarks

* fix gpu tests

* are you happy clippy
2025-05-22 22:57:48 +02:00
Arnaud Gourlay
1da478c897 Fix strict mode unindexed group_by path (#6363)
* Fix strict mode unindexed group_by path

* check index schema for matching support

* Handle disabled lookup on integer index
2025-05-22 22:56:24 +02:00
Tim Visée
7869c1ee90 Use byte strings for geohash (#6437)
* Use byte strings for geohash

* Don't take references
2025-05-22 22:56:02 +02:00