Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vector: refine vector search #9709

Merged
merged 18 commits into from
Dec 23, 2024
Merged

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>
dbms/src/Storages/DeltaMerge/File/DMFileReader.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/DeltaMerge/File/DMFileReader.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/DeltaMerge/File/DMFileReader.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/DeltaMerge/File/DMFileReader.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/DeltaMerge/File/DMFileReader.cpp Outdated Show resolved Hide resolved
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

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

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
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
5 checks passed
@Lloyd-Pottiger Lloyd-Pottiger deleted the optimize-vs branch December 23, 2024 05:36
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