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

issue#1503: memtable scan optimization #1504

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lwk135
Copy link

@Lwk135 Lwk135 commented Aug 10, 2023

Task Description

close #1503

Solution Description

(1) First, enable single edge table scan for memtable, which is the basis for later optimization.
(2) Second, acquire a batch of rows instead of only one.
(3) Third, use bitmap result to calculate the whole batch.

Passed Regressions

Upgrade Compatibility

Other Information

Release Note

@CLAassistant
Copy link

CLAassistant commented Aug 10, 2023

CLA assistant check
All committers have signed the CLA.

@Lwk135 Lwk135 marked this pull request as draft August 10, 2023 07:30
@Lwk135 Lwk135 marked this pull request as ready for review August 10, 2023 07:31
@Lwk135 Lwk135 marked this pull request as draft August 10, 2023 07:40
@hnwyllmm
Copy link
Contributor

please fill the pull request form, thanks

@Lwk135 Lwk135 force-pushed the memtable_scan_optimization_1503 branch 6 times, most recently from e68e0f3 to 3ceb0b1 Compare August 14, 2023 08:38
@@ -170,6 +171,27 @@ class ObMemtableScanIterator : public ObIMemtableScanIterator
uint8_t iter_flag_;
};

class ObMemtableBlockScanIterator : public ObMemtableScanIterator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe inherit the ObIMemtableScanIterator class here?

const common::ObIArray<blocksstable::ObStorageDatum> &default_datums = filter->get_default_datums();
const blocksstable::ObColDescIArray &cols_desc = read_info_->get_columns_desc();

for (int64_t row_idx = pd_filter_info.start_; OB_SUCC(ret) && row_idx < pd_filter_info.end_; ++row_idx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If pd_filter_info.start_ is always 0, perhaps we could use pd_filter_info.row_count_ to iterate all rows?

Use row_count appears to be clearer and more straightforward to comprehend for me.

if (filter->is_logic_and_node()) {
if (OB_FAIL(result->bit_and(*child_result))) {
LOG_WARN("Failed to merge result bitmap", K(ret), KP(child_result));
} else if (result->is_all_false()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add unittest case to test these situations :

  1. skip partitial rows in next child filter node
  2. skip all next child nodes when all_false or all_true

// TRANS_LOG(INFO, "Memtable scan iterator choice : normal");
// }
if (tenant_config.is_valid()) {
if (tenant_config->memtable_scan_filter_pushdown) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two suggestions:

  1. The code here is a little redundant.
  2. We can use _pushdown_storage_level config

@Lwk135 Lwk135 force-pushed the memtable_scan_optimization_1503 branch 5 times, most recently from e073cec to f43d6d6 Compare August 25, 2023 06:02
@Lwk135 Lwk135 force-pushed the memtable_scan_optimization_1503 branch 2 times, most recently from 2ad003d to 15ad5d1 Compare August 28, 2023 02:00
@Lwk135 Lwk135 force-pushed the memtable_scan_optimization_1503 branch from 15ad5d1 to aa21c19 Compare August 30, 2023 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Enable single edge scan and filter pushdown for memtable.
4 participants