You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/07/19 07:58:26 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #6236: Optimized the reading performance of Duplicate tables with severe data skew

morningman commented on a change in pull request #6236:
URL: https://github.com/apache/incubator-doris/pull/6236#discussion_r672072156



##########
File path: be/src/olap/tablet_meta.h
##########
@@ -285,6 +289,38 @@ inline void TabletMeta::set_cumulative_layer_point(int64_t new_point) {
     _cumulative_layer_point = new_point;
 }
 
+inline bool TabletMeta::contains_delete(const Version& version) const {
+    for (auto& rs : _rs_metas) {

Review comment:
       I am not sure if rs in _rs_metas are ordered by version?

##########
File path: be/src/olap/scan_range.h
##########
@@ -0,0 +1,56 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <map>
+
+#include "olap/rowset/rowset_meta.h"
+#include "olap/tuple.h"
+
+namespace doris {
+enum ScanRangeType { KEY = 0, SEGMENT = 1 };

Review comment:
       Add comment for this class and `ScanRangeType`

##########
File path: be/src/olap/tablet.cpp
##########
@@ -675,6 +676,62 @@ OLAPStatus Tablet::capture_rs_readers(const std::vector<Version>& version_path,
     return OLAP_SUCCESS;
 }
 
+OLAPStatus Tablet::capture_rs_readers_by_range(const Version& spec_version,
+                                               vector<RowsetReaderSharedPtr>* rs_readers,
+                                               const std::vector<OlapScanRange*>& key_ranges,
+                                               std::shared_ptr<MemTracker> parent_tracker) {
+    std::set<RowsetId> rowsets;
+    bool has_segment_range = false;
+    for (auto key_range : key_ranges) {
+        if (key_range->range_type == ScanRangeType::SEGMENT) {
+            for (const auto& s : key_range->segments) {
+                rowsets.emplace(s.first);
+            }
+            has_segment_range = true;
+        }
+    }
+    if (!has_segment_range) {

Review comment:
       Is it possible to have both KEY and SEGMENT key range in `key_ranges`?
   If yes, we should clear the `rs_readers` before calling `capture_rs_readers()`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org