Skip to content

2.25.1.0-b7

@arybochkin arybochkin tagged this 12 Dec 10:41
Summary:
This changed implements the following logic:
```
1. VectorId is generated  at DocDB level during storing a vector value.

2. Direct mapping from a row key to a vector id is stored inside vector's value at
   the end of vector value in the following format:
| ----------------------------------------------------|
|                  encoded vector id                  |
| ----------------------------------------------------|
|          vector id value          |     size of     |
| ----------------------------------|    vector id    |
|   value type    |    vector id    |      value      |
| ----------------------------------------------------|
|     1 byte      | kUuidSize bytes |     1 byte      |
| ----------------------------------------------------|

VectorId is sanitized from the vector value in the result set's rows while passing back to PG.

3. Reverse mapping from va ector id to a row key is stored in the indexed table
   in the additional section "Vector index metadata" in the following format:
|-----------------------------------------------------------------------|
|                     vector index metadata section                     |
|------------------------------------------------------|----------------|
|                           Key                        |     Value      |
|-----------------|-----------------------------------------------------|
|   vector index  |      vector id      |     doc      |   base table   |
| metadata prefix |        value        | hybrid time  |     row key    |
|-----------------------------------------------------------------------|
|  1 byte: 0x06   | 1 + kUuidSize bytes | 30 bytes max |   1 byte min   |
|-----------------------------------------------------------------------|

Reverse mapping is added during a transaction commit.
```
Jira: DB-13124

Test Plan: Jenkins

Reviewers: sergei, slingam

Reviewed By: sergei, slingam

Subscribers: yql, ybase

Differential Revision: https://phorge.dev.yugabyte.com/D40397
Assets 2
Loading