Skip to content

vector: refine vector search#9709

Merged
ti-chi-bot[bot] merged 18 commits intopingcap:masterfrom
Lloyd-Pottiger:optimize-vs
Dec 23, 2024
Merged

vector: refine vector search#9709
ti-chi-bot[bot] merged 18 commits intopingcap:masterfrom
Lloyd-Pottiger:optimize-vs

Conversation

@Lloyd-Pottiger
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger commented Dec 10, 2024

What problem does this PR solve?

Issue Number: ref #9032

Problem Summary:

What is changed and how it works?

Before, we read selected vector rows from the vector index and use default to replace other rows, and then do bitmap filtering to filter out other rows.

Now, we XXXVectorIndexReader only return selected rows, and only do bitmap filtering for files without the vector index.

Also:

  1. Remove useless lm_skip_rows in ScanContext.
  2. Pre-compute read block info to simplify DMFileReader.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 10, 2024
@Lloyd-Pottiger Lloyd-Pottiger changed the title vector: optimize read performance vector: refine vector search Dec 10, 2024
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
@JaySon-Huang
Copy link
Contributor

Some small comments Lloyd-Pottiger#20

* Add comments

Signed-off-by: JaySon-Huang <tshent@qq.com>

* Refine some codes

Signed-off-by: JaySon-Huang <tshent@qq.com>

---------

Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 20, 2024
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang
Copy link
Contributor

I'd like to keep the interface like this Lloyd-Pottiger#21 . This give us a picture that we organize the read by ReadBlockInfo.

https://github.com/Lloyd-Pottiger/tiflash/blob/e1b05e46b6d22dab11de6e75b5c81a6a14f93de4/dbms/src/Storages/DeltaMerge/File/DMFileReader.h#L115-L120

But I'm OK with the current status.

Rest LGTM

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, JinheLin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [JaySon-Huang,JinheLin]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Dec 23, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Dec 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-20 09:48:53.944570063 +0000 UTC m=+1209524.033372601: ☑️ agreed by JinheLin.
  • 2024-12-23 04:08:38.309558819 +0000 UTC m=+1448308.398361358: ☑️ agreed by JaySon-Huang.

@ti-chi-bot ti-chi-bot bot merged commit a55423c into pingcap:master Dec 23, 2024
@Lloyd-Pottiger Lloyd-Pottiger deleted the optimize-vs branch December 23, 2024 05:36
@JaySon-Huang JaySon-Huang mentioned this pull request Mar 6, 2025
12 tasks
yongman pushed a commit to yongman/tiflash that referenced this pull request Jun 18, 2025
pingcap#9709

Signed-off-by: Wish <breezewish@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants