This is an automated email from the ASF dual-hosted git repository.

zhangchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c67af6ccd0 [fix](cluster key) improve cluster key lookup rowkey 
(#42470)
8c67af6ccd0 is described below

commit 8c67af6ccd09af8fa300966aa502f3511f4ea3a2
Author: meiyi <[email protected]>
AuthorDate: Wed Nov 6 21:39:54 2024 +0800

    [fix](cluster key) improve cluster key lookup rowkey (#42470)
    
    the min max key in mow with cluster key tables is also the min and max
    of primay keys, so when lookup rowkey, can use it to filter some
    segments.
---
 be/src/olap/base_tablet.cpp | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/be/src/olap/base_tablet.cpp b/be/src/olap/base_tablet.cpp
index 1e819de7c55..e5ec3873815 100644
--- a/be/src/olap/base_tablet.cpp
+++ b/be/src/olap/base_tablet.cpp
@@ -468,13 +468,9 @@ Status BaseTablet::lookup_row_key(const Slice& 
encoded_key, TabletSchema* latest
         DCHECK_EQ(segments_key_bounds.size(), num_segments);
         std::vector<uint32_t> picked_segments;
         for (int i = num_segments - 1; i >= 0; i--) {
-            // If mow table has cluster keys, the key bounds is short keys, 
not primary keys
-            // use PrimaryKeyIndexMetaPB in primary key index?
-            if (schema->cluster_key_idxes().empty()) {
-                if (key_without_seq.compare(segments_key_bounds[i].max_key()) 
> 0 ||
-                    key_without_seq.compare(segments_key_bounds[i].min_key()) 
< 0) {
-                    continue;
-                }
+            if (key_without_seq.compare(segments_key_bounds[i].max_key()) > 0 
||
+                key_without_seq.compare(segments_key_bounds[i].min_key()) < 0) 
{
+                continue;
             }
             picked_segments.emplace_back(i);
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to