You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2026/06/12 03:43:19 UTC

(impala) branch master updated: IMPALA-14796: Show effective runtime filter targets in profile

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

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f6fdc0f3 IMPALA-14796: Show effective runtime filter targets in profile
8f6fdc0f3 is described below

commit 8f6fdc0f3910503556fc088cc4ef306ac5e96009
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Fri Mar 20 19:05:03 2026 +0800

    IMPALA-14796: Show effective runtime filter targets in profile
    
    This patch adds an "Eff. Tgt. Node(s)" (Effective Target Node(s)) column
    to the "Final filter table" in the query profile. This shows which scan
    nodes actually had rows rejected by each runtime filter, distinguishing
    filters that were effective from those that were applied but rejected no
    data. E.g.
    
     ID  Src. Node  Tgt. Node(s)  Eff. Tgt. Node(s)     Target type  ...
    --------------------------------------------------------------------
     10          6             2                  2           LOCAL  ...
      8          7             1                  1          REMOTE  ...
      5          8             2                  2           LOCAL  ...
      4          8             0                  N          REMOTE  ...
      2          9          0, 3               0, 3  REMOTE, REMOTE  ...
      0         10             4                  4          REMOTE  ...
    
    In the above example, filter 4 has "N" in the "Eff. Tgt. Node(s)"
    column, which means it doesn't filter out any rows, i.e. effective
    target node is "None". All the other filters are effective.
    
    Implementation
     - In ScanNode::Close(), collect the effective runtime filter ids by
       checking the "rejected" counters of all the FilterStats. These
       counters correspond to "Files rejected", "RowGroups rejected", "Rows
       rejected", "Splits rejected" in the query profile. If any of them is
       non-zero, the filter has rejected some data so it's effective.
     - Executor reports this info to coordinator via ReportExecStatus RPCs.
       A list of (filter_id, scan_node_id) pairs is added in
       ReportExecStatusRequestPB to carry this info.
     - Coordinator aggregates the effective filter targets when processing
       the status reports.
     - In FilterDebugString(), add a column to show the node ids where the
       runtime filter is effective.
    
    Other minor changes
     - In coordinator.cc, move the code of setting the "Final filter table"
       from ReleaseExecResources() to ComputeQuerySummary() to ensure the
       final status reports from backends all arrive.
     - Removed temp_object_pool and temp_mem_tracker from
       FilterDebugString() as they have been unused since commit a985e11.
     - Replaced boost::lexical_cast<string> with std::to_string in
       converting int to string which is more optimized.
     - Sort node ids in "Tgt. Node(s)" and "Eff. Tgt. Node(s)" columns to
       make the output consistent across different runs.
    
    Limitation
     - Kudu scanner doesn't expose metrics reflecting effect of individual
       filters so we can't detect effective runtime filters on KuduScanNode.
       Currently the "Eff. Tgt. Node(s)" column of them always has value "N"
       (IMPALA-15002).
    
    Tests
     - Added e2e test for TPCH-Q5 where some filters are ineffective in
       both the original profile and aggregated profile modes.
     - Added checks in runtime_filters.test for queries that have only one
       runtime filter.
     - Updated in_list_filters.test for the new column.
     - Ran tests on both the original planner and the calcite planner.
    
    Assisted-by: Claude Sonnet 4.5
    Change-Id: Iccf4b87ac4579a70273f3306ec7b58850f06b17c
    Reviewed-on: http://gerrit.cloudera.org:8080/24123
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/exec/filter-context.cc                      |  9 +++
 be/src/exec/filter-context.h                       |  4 ++
 be/src/exec/scan-node.cc                           |  6 ++
 be/src/exec/scan-node.h                            |  8 +++
 be/src/runtime/coordinator-filter-state.h          |  8 +++
 be/src/runtime/coordinator.cc                      | 40 +++++++++---
 be/src/runtime/coordinator.h                       |  6 ++
 be/src/runtime/fragment-instance-state.cc          | 12 ++++
 be/src/runtime/fragment-instance-state.h           |  9 +++
 be/src/runtime/query-state.cc                      | 11 ++++
 common/protobuf/control_service.proto              | 12 ++++
 .../queries/QueryTest/in_list_filters.test         | 38 ++++++------
 .../queries/QueryTest/runtime_filters.test         |  3 +
 .../tpch/queries/effective-runtime-filter.test     | 71 ++++++++++++++++++++++
 tests/custom_cluster/test_observability.py         | 11 ++++
 tests/query_test/test_runtime_filters.py           | 22 +++++++
 16 files changed, 241 insertions(+), 29 deletions(-)

diff --git a/be/src/exec/filter-context.cc b/be/src/exec/filter-context.cc
index db23287e9..7adc4fa76 100644
--- a/be/src/exec/filter-context.cc
+++ b/be/src/exec/filter-context.cc
@@ -66,6 +66,15 @@ void FilterStats::RegisterCounterGroup(const string& key) {
   counters[key] = counter;
 }
 
+bool FilterStats::HasRejectedRows() const {
+  for (const auto& entry : counters) {
+    if (entry.second.rejected->value() > 0) {
+      return true;
+    }
+  }
+  return false;
+}
+
 Status FilterContext::CloneFrom(const FilterContext& from, ObjectPool* pool,
     RuntimeState* state, MemPool* expr_perm_pool, MemPool* expr_results_pool) {
   filter = from.filter;
diff --git a/be/src/exec/filter-context.h b/be/src/exec/filter-context.h
index e94b2d362..d0e68aa44 100644
--- a/be/src/exec/filter-context.h
+++ b/be/src/exec/filter-context.h
@@ -73,6 +73,10 @@ class FilterStats {
   /// Adds a new counter group with key 'key'. Not thread safe.
   void RegisterCounterGroup(const std::string& key);
 
+  /// Returns true if any of the filter's rejection counters have a value > 0.
+  /// This indicates the filter was effective at rejecting rows.
+  bool HasRejectedRows() const;
+
  private:
   /// Map from some key to statistics for that key.
   typedef boost::unordered_map<std::string, CounterGroup> CountersMap;
diff --git a/be/src/exec/scan-node.cc b/be/src/exec/scan-node.cc
index 866c73efe..7ebfb27e3 100644
--- a/be/src/exec/scan-node.cc
+++ b/be/src/exec/scan-node.cc
@@ -196,6 +196,12 @@ Status ScanNode::Open(RuntimeState* state) {
 
 void ScanNode::Close(RuntimeState* state) {
   if (is_closed()) return;
+  // Compute effective filters by checking if any rows were rejected.
+  for (const auto& filter_ctx : filter_ctxs_) {
+    if (filter_ctx.stats != nullptr && filter_ctx.stats->HasRejectedRows()) {
+      effective_filter_ids_.push_back(filter_ctx.filter->id());
+    }
+  }
   // Close filter
   for (auto& filter_ctx : filter_ctxs_) {
     if (filter_ctx.expr_eval != nullptr) filter_ctx.expr_eval->Close(state);
diff --git a/be/src/exec/scan-node.h b/be/src/exec/scan-node.h
index 3e47de395..9a6df809a 100644
--- a/be/src/exec/scan-node.h
+++ b/be/src/exec/scan-node.h
@@ -141,6 +141,10 @@ class ScanNode : public ExecNode {
 
   const std::vector<FilterContext>& filter_ctxs() const { return filter_ctxs_; }
 
+  const std::vector<int32_t>& effective_filter_ids() const {
+    return effective_filter_ids_;
+  }
+
  protected:
   RuntimeState* runtime_state_ = nullptr;
 
@@ -183,6 +187,10 @@ class ScanNode : public ExecNode {
   /// the per-scanner ScannerContext. Correspond to exprs in 'filter_exprs_'.
   std::vector<FilterContext> filter_ctxs_;
 
+  /// Filter IDs that were effective (rejected rows) at this scan node.
+  /// Populated in Close().
+  std::vector<int32_t> effective_filter_ids_;
+
   /// Initializes 'bytes_read_counter_', 'bytes_read_timeseries_counter_' and
   /// 'total_throughput_counter_'
   void AddBytesReadCounters();
diff --git a/be/src/runtime/coordinator-filter-state.h b/be/src/runtime/coordinator-filter-state.h
index fd490f79f..d35a5c6d9 100644
--- a/be/src/runtime/coordinator-filter-state.h
+++ b/be/src/runtime/coordinator-filter-state.h
@@ -133,6 +133,14 @@ class Coordinator::FilterState {
   // Display a FilterState object without creating an MinMaxFilter first.
   std::string DebugString() const;
 
+  /// Sorts the targets_ vector by node_id in ascending order.
+  void SortTargets() {
+    std::sort(targets_.begin(), targets_.end(),
+        [](const FilterTarget& a, const FilterTarget& b) {
+          return a.node_id < b.node_id;
+        });
+  }
+
  private:
   /// Contains the specification of the runtime filter.
   TRuntimeFilterDesc desc_;
diff --git a/be/src/runtime/coordinator.cc b/be/src/runtime/coordinator.cc
index b095c90fd..72d899bed 100644
--- a/be/src/runtime/coordinator.cc
+++ b/be/src/runtime/coordinator.cc
@@ -26,7 +26,6 @@
 #include <thrift/protocol/TDebugProtocol.h>
 #include <boost/algorithm/string/join.hpp>
 #include <boost/filesystem.hpp>
-#include <boost/lexical_cast.hpp>
 #include <boost/algorithm/string/split.hpp>
 #include <boost/algorithm/string.hpp>
 #include <gutil/strings/substitute.h>
@@ -423,6 +422,10 @@ void Coordinator::InitFilterRoutingTable() {
     }
   }
 
+  for (auto& entry : filter_routing_table_->id_to_filter) {
+    entry.second.SortTargets();
+  }
+
   query_profile_->AddInfoString(
       "Number of filters", Substitute("$0", filter_routing_table_->num_filters()));
   query_profile_->AddInfoString("Filter routing table", FilterDebugString());
@@ -659,6 +662,7 @@ string Coordinator::FilterDebugString() {
   table_printer.AddColumn("ID", false);
   table_printer.AddColumn("Src. Node", false);
   table_printer.AddColumn("Tgt. Node(s)", false);
+  table_printer.AddColumn("Eff. Tgt. Node(s)", false);
   table_printer.AddColumn("Target type", false);
   table_printer.AddColumn("Partition filter", false);
   // Distribution metrics are only meaningful if the coordinator is routing the filter.
@@ -673,22 +677,29 @@ string Coordinator::FilterDebugString() {
   table_printer.AddColumn("Min value", false);
   table_printer.AddColumn("Max value", false);
   table_printer.AddColumn("In-list size", false);
-  ObjectPool temp_object_pool;
-  MemTracker temp_mem_tracker;
   for (auto& v: filter_routing_table_->id_to_filter) {
     vector<string> row;
     const FilterState& state = v.second;
-    row.push_back(lexical_cast<string>(v.first));
-    row.push_back(lexical_cast<string>(state.desc().src_node_id));
+    row.push_back(std::to_string(v.first));
+    row.push_back(std::to_string(state.desc().src_node_id));
     vector<string> target_ids;
     vector<string> target_types;
     vector<string> partition_filter;
     for (const FilterTarget& target: state.targets()) {
-      target_ids.push_back(lexical_cast<string>(target.node_id));
+      target_ids.push_back(std::to_string(target.node_id));
       target_types.push_back(target.is_local ? "LOCAL" : "REMOTE");
       partition_filter.push_back(target.is_bound_by_partition_columns ? "true" : "false");
     }
     row.push_back(join(target_ids, ", "));
+    vector<string> effective_target_ids;
+    auto eff_it = effective_filter_targets_.find(v.first);
+    if (eff_it != effective_filter_targets_.end()) {
+      for (TPlanNodeId node_id : eff_it->second) {
+        effective_target_ids.push_back(std::to_string(node_id));
+      }
+    }
+    // "N" means in "None" of the nodes the filter is effective.
+    row.push_back(effective_target_ids.empty() ? "N" : join(effective_target_ids, ", "));
     row.push_back(join(target_types, ", "));
     row.push_back(join(partition_filter, ", "));
 
@@ -787,7 +798,6 @@ string Coordinator::FilterDebugString() {
     }
     table_printer.AddRow(row);
   }
-  temp_mem_tracker.Close();
   // Add a line break, as in all contexts this is called we need to start a new line to
   // print it correctly.
   return Substitute("\n$0", table_printer.ToString());
@@ -1142,6 +1152,11 @@ Status Coordinator::UpdateBackendExecStatus(const ReportExecStatusRequestPB& req
   if (backend_state->ApplyExecStatusReport(request, thrift_profiles, &exec_summary_,
           &scan_progress_, &query_progress_, &dml_exec_state_, &aux_error_info,
           fragment_stats_)) {
+    // Merge effective filter targets from backend report
+    for (const EffectiveFilterTargetPB& target : request.effective_filter_targets()) {
+      effective_filter_targets_[target.filter_id()].insert(target.scan_node_id());
+    }
+
     // This backend execution has completed.
     if (VLOG_QUERY_IS_ON) {
       // Don't log backend completion if the query has already been cancelled.
@@ -1465,6 +1480,14 @@ void Coordinator::ComputeQuerySummary() {
       query_profile_->AddInfoString("Backend OS Info", os_summary);
     }
   }
+
+  // Update the final filter table.
+  {
+    lock_guard<shared_mutex> lock(filter_routing_table_->lock);
+    if (filter_routing_table_->num_filters() > 0) {
+      query_profile_->AddInfoString("Final filter table", FilterDebugString());
+    }
+  }
 }
 
 string Coordinator::GetErrorLog() {
@@ -1479,9 +1502,6 @@ string Coordinator::GetErrorLog() {
 
 void Coordinator::ReleaseExecResources() {
   lock_guard<shared_mutex> lock(filter_routing_table_->lock); // Exclusive lock.
-  if (filter_routing_table_->num_filters() > 0) {
-    query_profile_->AddInfoString("Final filter table", FilterDebugString());
-  }
 
   for (auto& filter : filter_routing_table_->id_to_filter) {
     unique_lock<SpinLock> l(filter.second.lock());
diff --git a/be/src/runtime/coordinator.h b/be/src/runtime/coordinator.h
index b8ea6533e..cbc334506 100644
--- a/be/src/runtime/coordinator.h
+++ b/be/src/runtime/coordinator.h
@@ -18,7 +18,9 @@
 #pragma once
 
 #include <list>
+#include <map>
 #include <memory>
+#include <set>
 #include <string>
 #include <vector>
 #include <utility>
@@ -517,6 +519,10 @@ class Coordinator { // NOLINT: The member variables could be re-ordered to save
   /// Contains all the state about filters being handled by this coordinator.
   std::unique_ptr<FilterRoutingTable> filter_routing_table_;
 
+  /// Cached map from filter ID to target node IDs where the filter rejected data.
+  /// Populated by BackendState::ApplyExecStatusReport().
+  std::map<int32_t, std::set<TPlanNodeId>> effective_filter_targets_;
+
   /// True if the first row has been fetched, false otherwise.
   bool first_row_fetched_ = false;
 
diff --git a/be/src/runtime/fragment-instance-state.cc b/be/src/runtime/fragment-instance-state.cc
index 66ddb2555..c4e0378b6 100644
--- a/be/src/runtime/fragment-instance-state.cc
+++ b/be/src/runtime/fragment-instance-state.cc
@@ -395,6 +395,18 @@ void FragmentInstanceState::GetStatusReport(FragmentInstanceExecStatusPB* instan
   total_bytes_sent_  = total_bytes_sent;
   per_join_rows_produced_ = per_join_rows_produced;
 
+  // Aggregate effective filter targets from scan nodes.
+  if (exec_tree_ != nullptr) {
+    vector<ExecNode*> scan_nodes;
+    exec_tree_->CollectScanNodes(&scan_nodes);
+    for (ExecNode* node : scan_nodes) {
+      ScanNode* scan_node = static_cast<ScanNode*>(node);
+      for (int32_t filter_id : scan_node->effective_filter_ids()) {
+        per_scan_effective_filters_.insert({filter_id, scan_node->id()});
+      }
+    }
+  }
+
   // Send the DML stats if this is the final report.
   if (done) {
     runtime_state()->dml_exec_state()->ToProto(
diff --git a/be/src/runtime/fragment-instance-state.h b/be/src/runtime/fragment-instance-state.h
index eda531dd7..76dd28df8 100644
--- a/be/src/runtime/fragment-instance-state.h
+++ b/be/src/runtime/fragment-instance-state.h
@@ -18,6 +18,7 @@
 #pragma once
 
 #include <mutex>
+#include <set>
 #include <string>
 #include <boost/scoped_ptr.hpp>
 
@@ -154,6 +155,9 @@ class FragmentInstanceState {
   const std::map<int32_t, int64_t>& per_join_rows_produced() const {
     return per_join_rows_produced_;
   }
+  const std::set<std::pair<int32_t, int32_t>>& per_scan_effective_filters() const {
+    return per_scan_effective_filters_;
+  }
 
   /// Returns true if the current thread is a thread executing the whole or part of
   /// a fragment instance.
@@ -223,6 +227,11 @@ class FragmentInstanceState {
   /// Set in GetStatusReport().
   std::map<int32_t, int64_t> per_join_rows_produced_;
 
+  /// Effective filter targets at scan nodes in this fragment instance.
+  /// Updated in GetStatusReport(). Using a set to automatically handle duplicates across
+  /// periodic calls.
+  std::set<std::pair<int32_t, int32_t>> per_scan_effective_filters_;
+
   /// Profile for timings for each stage of the plan fragment instance's lifecycle.
   /// Lives in obj_pool().
   RuntimeProfile* timings_profile_ = nullptr;
diff --git a/be/src/runtime/query-state.cc b/be/src/runtime/query-state.cc
index 0ef4ede6d..a24962332 100644
--- a/be/src/runtime/query-state.cc
+++ b/be/src/runtime/query-state.cc
@@ -627,6 +627,17 @@ void QueryState::ConstructReport(bool instances_started,
       MergeMapValues(fis->per_join_rows_produced(), &per_join_rows_produced);
     }
 
+    // Aggregate effective filter targets across instances. Do this after
+    // GetStatusReport() since it updates the effective filter targets.
+    for (const auto& entry : fis_map_) {
+      FragmentInstanceState* fis = entry.second;
+      for (const auto& [filter_id, scan_node_id] : fis->per_scan_effective_filters()) {
+        auto* target = report->add_effective_filter_targets();
+        target->set_filter_id(filter_id);
+        target->set_scan_node_id(scan_node_id);
+      }
+    }
+
     // Construct the per-fragment status reports, including runtime profiles.
     for (const auto& entry : agg_profiles) {
       int fragment_idx = entry.first;
diff --git a/common/protobuf/control_service.proto b/common/protobuf/control_service.proto
index 9cad3203f..6d84b3f3f 100644
--- a/common/protobuf/control_service.proto
+++ b/common/protobuf/control_service.proto
@@ -234,6 +234,14 @@ message FragmentExecStatusPB {
   optional int32 min_per_fragment_instance_idx = 2;
 }
 
+message EffectiveFilterTargetPB {
+  // The runtime filter id.
+  optional int32 filter_id = 1;
+
+  // The scan node id where this runtime filter rejected data.
+  optional int32 scan_node_id = 2;
+}
+
 message ReportExecStatusRequestPB {
   // The query id which this report is for.
   optional UniqueIdPB query_id = 1;
@@ -293,6 +301,10 @@ message ReportExecStatusRequestPB {
   // If true, the executor failed to execute query fragments due to local disk IO
   // fatal error, like local storage devices for spilling are corrupted.
   optional bool local_disk_faulty = 17 [default = false];
+
+  // List of (filter_id, scan_node_id) pairs representing which runtime filters were
+  // effective (rejected rows) at which scan nodes.
+  repeated EffectiveFilterTargetPB effective_filter_targets = 18;
 }
 
 message ReportExecStatusResponsePB {
diff --git a/testdata/workloads/functional-query/queries/QueryTest/in_list_filters.test b/testdata/workloads/functional-query/queries/QueryTest/in_list_filters.test
index 612e6d08c..0ceeb2e8f 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/in_list_filters.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/in_list_filters.test
@@ -176,16 +176,16 @@ row_regex: RowsRead: 2.43K \(2433\)
 # generated by the build side of scanning b, and is applied to
 # the scan node that scans a.
 #
-# ID  Src. Node  Tgt. Node(s)  Target type  Partition filter  Pending (Expected)  First arrived  Completed  Enabled  Bloom Size  Est fpp  Min value  Max value     In-list size
-#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-#  1          3             0        LOCAL             false               0 (3)            N/A        N/A     true     IN_LIST                                           LOCAL
-#  0          4             1       REMOTE             false               0 (3)      431.952ms  431.953ms     true     IN_LIST                                               1
+# ID  Src. Node  Tgt. Node(s)  Eff. Tgt. Node(s)  Target type  Partition filter  Pending (Expected)  First arrived  Completed  Enabled  Bloom Size  Est fpp  Min value  Max value     In-list size
+#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+#  1          3             0                  N        LOCAL             false               0 (3)            N/A        N/A     true     IN_LIST                                           LOCAL
+#  0          4             1                  N       REMOTE             false               0 (3)      431.952ms  431.953ms     true     IN_LIST                                               1
 select STRAIGHT_JOIN count(*) from alltypes t, alltypestiny a, alltypestiny b
 where t.id = a.id and a.tinyint_col = b.tinyint_col and b.id = 0;
 ---- RESULTS
 4
 ---- RUNTIME_PROFILE
-row_regex: 0\s+4\s+1\s+REMOTE\s+false.*IN_LIST\s+1
+row_regex: 0\s+4\s+1\s+N\s+REMOTE\s+false.*IN_LIST\s+1
 row_regex: Filter 0 arrival with 1 items
 ====
 ---- QUERY
@@ -195,7 +195,7 @@ where t.id = a.id and a.smallint_col = b.smallint_col and b.id = 0;
 ---- RESULTS
 4
 ---- RUNTIME_PROFILE
-row_regex: 0\s+4\s+1\s+REMOTE\s+false.*IN_LIST\s+1
+row_regex: 0\s+4\s+1\s+N\s+REMOTE\s+false.*IN_LIST\s+1
 row_regex: Filter 0 arrival with 1 items
 ====
 ---- QUERY
@@ -205,7 +205,7 @@ where t.id = a.id and a.int_col = b.int_col and b.id = 0;
 ---- RESULTS
 4
 ---- RUNTIME_PROFILE
-row_regex: 0\s+4\s+1\s+REMOTE\s+false.*IN_LIST\s+1
+row_regex: 0\s+4\s+1\s+N\s+REMOTE\s+false.*IN_LIST\s+1
 row_regex: Filter 0 arrival with 1 items
 ====
 ---- QUERY
@@ -215,7 +215,7 @@ where t.id = a.id and a.bigint_col = b.bigint_col and b.id = 0;
 ---- RESULTS
 4
 ---- RUNTIME_PROFILE
-row_regex: 0\s+4\s+1\s+REMOTE\s+false.*IN_LIST\s+1
+row_regex: 0\s+4\s+1\s+N\s+REMOTE\s+false.*IN_LIST\s+1
 row_regex: Filter 0 arrival with 1 items
 ====
 ---- QUERY
@@ -225,16 +225,16 @@ where t.id = a.id and a.string_col = b.string_col and b.id = 0;
 ---- RESULTS
 4
 ---- RUNTIME_PROFILE
-row_regex: 0\s+4\s+1\s+REMOTE\s+false.*IN_LIST\s+1
+row_regex: 0\s+4\s+1\s+N\s+REMOTE\s+false.*IN_LIST\s+1
 row_regex: Filter 0 arrival with 1 items
 ====
 ---- QUERY
 # IMPALA-11707: Regression test on global IN-list filter on DATE type
 # Final filter table:
-# ID  Src. Node  Tgt. Node(s)  Target type  Partition filter  Pending (Expected)  First arrived  Completed  Enabled  Bloom Size  Est fpp  Min value  Max value     In-list size
-#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-#  1          3             0        LOCAL             false               0 (3)            N/A        N/A     true     IN_LIST                                           LOCAL
-#  0          4             1       REMOTE             false               0 (3)      427.938ms  427.947ms     true     IN_LIST                                               5
+# ID  Src. Node  Tgt. Node(s)  Eff. Tgt. Node(s)  Target type  Partition filter  Pending (Expected)  First arrived  Completed  Enabled  Bloom Size  Est fpp  Min value  Max value     In-list size
+#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+#  1          3             0                  N        LOCAL             false               0 (3)            N/A        N/A     true     IN_LIST                                           LOCAL
+#  0          4             1                  N       REMOTE             false               0 (3)      427.938ms  427.947ms     true     IN_LIST                                               5
 select STRAIGHT_JOIN count(*)
 from date_tbl t
 join [BROADCAST] date_tbl a on t.id_col = a.id_col
@@ -243,16 +243,16 @@ where b.id_col < 5;
 ---- RESULTS
 7
 ---- RUNTIME_PROFILE
-row_regex: 0\s+4\s+1\s+REMOTE\s+false.*IN_LIST\s+5
+row_regex: 0\s+4\s+1\s+N\s+REMOTE\s+false.*IN_LIST\s+5
 row_regex: Filter 0 arrival with 5 items
 ====
 ---- QUERY
 # IMPALA-11707: Regression test on global IN-list filter
 # Final filter table:
-# ID  Src. Node  Tgt. Node(s)  Target type  Partition filter  Pending (Expected)  First arrived  Completed  Enabled  Bloom Size  Est fpp  Min value  Max value     In-list size
-#------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-#  1          3             0        LOCAL             false               0 (1)            N/A        N/A     true     IN_LIST                                           LOCAL
-#  0          4             1       REMOTE             false               0 (1)       87.270ms   87.271ms     true     IN_LIST                                               1
+# ID  Src. Node  Tgt. Node(s)  Eff. Tgt. Node(s)  Target type  Partition filter  Pending (Expected)  First arrived  Completed  Enabled  Bloom Size  Est fpp  Min value  Max value     In-list size
+#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+#  1          3             0                  N        LOCAL             false               0 (1)            N/A        N/A     true     IN_LIST                                           LOCAL
+#  0          4             1                  N       REMOTE             false               0 (1)       87.270ms   87.271ms     true     IN_LIST                                               1
 select STRAIGHT_JOIN count(*)
 from tpch_orc_def.supplier, tpch_orc_def.nation, tpch_orc_def.region
 where s_nationkey = n_nationkey
@@ -261,6 +261,6 @@ where s_nationkey = n_nationkey
 ---- RESULTS
 1987
 ---- RUNTIME_PROFILE
-row_regex: 0\s+4\s+1\s+REMOTE\s+false.*IN_LIST\s+1
+row_regex: 0\s+4\s+1\s+N\s+REMOTE\s+false.*IN_LIST\s+1
 row_regex: Filter 0 arrival with 1 items
 ====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/runtime_filters.test b/testdata/workloads/functional-query/queries/QueryTest/runtime_filters.test
index ad5f3009a..c39b22779 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/runtime_filters.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/runtime_filters.test
@@ -122,6 +122,7 @@ select STRAIGHT_JOIN count(*) from alltypes a
 ---- RESULTS
 0
 ---- RUNTIME_PROFILE
+row_regex: 0\s+2\s+0\s+0\s+LOCAL\s+true
 aggregation(SUM, RowsRead): 8
 aggregation(SUM, Files rejected): 24
 ---- RUNTIME_PROFILE: table_format=kudu
@@ -217,6 +218,7 @@ select STRAIGHT_JOIN count(*) from alltypes a
 ---- RESULTS
 2480
 ---- RUNTIME_PROFILE
+row_regex: 0\s+2\s+0\s+0\s+LOCAL\s+true
 aggregation(SUM, Files rejected): 23
 ---- RUNTIME_PROFILE: table_format=kudu
 row_regex: 00:SCAN KUDU.*s[ ]+7.30K[ ]+7.30K
@@ -297,6 +299,7 @@ select STRAIGHT_JOIN count(*) from alltypesagg a
 ---- RESULTS
 1000
 ---- RUNTIME_PROFILE
+row_regex: 0\s+2\s+0\s+0\s+LOCAL\s+true
 aggregation(SUM, Files rejected): 10
 ---- RUNTIME_PROFILE: table_format=kudu
 row_regex: 00:SCAN KUDU.*s[ ]+11.00K[ ]+11.00K
diff --git a/testdata/workloads/tpch/queries/effective-runtime-filter.test b/testdata/workloads/tpch/queries/effective-runtime-filter.test
new file mode 100644
index 000000000..0f7df0d21
--- /dev/null
+++ b/testdata/workloads/tpch/queries/effective-runtime-filter.test
@@ -0,0 +1,71 @@
+====
+---- QUERY
+# Verify the runtime filter table for TPCH-Q5 where some filters are ineffective.
+# The query is modified to use a fix join order.
+use tpch_parquet;
+set runtime_filter_wait_time_ms=10000;
+select STRAIGHT_JOIN
+  n_name,
+  sum(l_extendedprice * (1 - l_discount)) as revenue
+from
+  lineitem,
+  orders,
+  customer,
+  supplier,
+  nation,
+  region
+where
+  c_custkey = o_custkey
+  and l_orderkey = o_orderkey
+  and l_suppkey = s_suppkey
+  and c_nationkey = s_nationkey
+  and s_nationkey = n_nationkey
+  and n_regionkey = r_regionkey
+  and r_name = 'ASIA'
+  and o_orderdate >= '1994-01-01'
+  and o_orderdate < '1995-01-01'
+group by
+  n_name
+order by
+  revenue desc
+---- RESULTS
+'INDONESIA',55502041.1697
+'VIETNAM',55295086.9967
+'CHINA',53724494.2566
+'INDIA',52035512.0002
+'JAPAN',45410175.6954
+---- TYPES
+string, decimal
+---- RUNTIME_PROFILE
+# Verify Final filter table:
+#  ID  Src. Node  Tgt. Node(s)  Eff. Tgt. Node(s)     Target type  ...
+# --------------------------------------------------------------------
+#   8          7             1                  1          REMOTE  ...
+#   4          8             2                  N          REMOTE  ...
+#   2          9          2, 3               2, 3  REMOTE, REMOTE  ...
+#   0         10             4                  4          REMOTE  ...
+#  10          6             0                  0           LOCAL  ...
+#   5          8             0                  0           LOCAL  ...
+row_regex: 8\s+7\s+1\s+1\s+REMOTE
+row_regex: 4\s+8\s+2\s+N\s+REMOTE
+row_regex: 2\s+9\s+2,\ 3\s+2,\ 3\s+REMOTE,\s*REMOTE
+row_regex: 0\s+10\s+4\s+4\s+REMOTE
+row_regex: 10\s+6\s+0\s+0\s+LOCAL
+row_regex: 5\s+8\s+0\s+0\s+LOCAL
+---- CALCITE_PLANNER_RUNTIME_PROFILE
+# Verify Final filter table:
+#  ID  Src. Node  Tgt. Node(s)  Eff. Tgt. Node(s)     Target type  ...
+# --------------------------------------------------------------------
+#  10          2             0                  0           LOCAL  ...
+#   8          4             1                  1          REMOTE  ...
+#   5          6             0                  0           LOCAL  ...
+#   4          6             3                  N          REMOTE  ...
+#   2          8          3, 5               3, 5  REMOTE, REMOTE  ...
+#   0         10             7                  7          REMOTE  ...
+row_regex: 10\s+2\s+0\s+0\s+LOCAL
+row_regex: 8\s+4\s+1\s+1\s+REMOTE
+row_regex: 5\s+6\s+0\s+0\s+LOCAL
+row_regex: 4\s+6\s+3\s+N\s+REMOTE
+row_regex: 2\s+8\s+3,\ 5\s+3,\ 5\s+REMOTE,\ REMOTE
+row_regex: 0\s+10\s+7\s+7\s+REMOTE
+====
diff --git a/tests/custom_cluster/test_observability.py b/tests/custom_cluster/test_observability.py
index ec0a5b273..e30a2a34a 100644
--- a/tests/custom_cluster/test_observability.py
+++ b/tests/custom_cluster/test_observability.py
@@ -25,6 +25,11 @@ from tests.util.query_profile_util import verify_profile_node_lifecycle_events
 
 
 class TestObservability(CustomClusterTestSuite):
+
+  @classmethod
+  def get_workload(self):
+    return 'tpch'
+
   @pytest.mark.execute_serially
   def test_host_profile_jvm_gc_metrics(self, unique_database):
     self.execute_query_expect_success(self.client,
@@ -90,3 +95,9 @@ class TestObservability(CustomClusterTestSuite):
     runtime_profile = self.execute_query(query).runtime_profile
     assert "SYSTEM_TABLE_SCAN_NODE" in runtime_profile
     verify_profile_node_lifecycle_events(runtime_profile)
+
+  @pytest.mark.execute_serially
+  @CustomClusterTestSuite.with_args('--gen_experimental_profile=true')
+  def test_effective_runtime_filter(self, vector):
+    """Verify the runtime filter table shows ineffective filters."""
+    self.run_test_case('effective-runtime-filter', vector)
diff --git a/tests/query_test/test_runtime_filters.py b/tests/query_test/test_runtime_filters.py
index fd7fec0d8..ae418322f 100644
--- a/tests/query_test/test_runtime_filters.py
+++ b/tests/query_test/test_runtime_filters.py
@@ -487,3 +487,25 @@ class TestRuntimeFiltersLateRemoteUpdate(ImpalaTestSuite):
     assert duration_s < (WAIT_TIME_MS / 1000), \
         "Query took too long (%ss, possibly waiting for late filters?)" \
         % str(duration_s)
+
+
+@pytest.mark.execute_serially
+@SkipIfLocal.multiple_impalad
+class TestRuntimeFilterEffectiveness(ImpalaTestSuite):
+
+  @classmethod
+  def get_workload(cls):
+    return 'tpch'
+
+  @classmethod
+  def add_test_dimensions(cls):
+    super(TestRuntimeFilterEffectiveness, cls).add_test_dimensions()
+    # Only test parquet/none format
+    cls.ImpalaTestMatrix.add_constraint(
+        lambda v: v.get_value('table_format').file_format == 'parquet'
+        and v.get_value('table_format').compression_codec == 'none')
+    add_exec_option_dimension(cls, 'mt_dop', DIM_MT_DOP_MEDIUM)
+
+  def test_effective_runtime_filter(self, vector):
+    """Verify the runtime filter table shows ineffective filters."""
+    self.run_test_case('effective-runtime-filter', vector)