You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2019/09/07 18:56:16 UTC

[impala] branch master updated (fdde669 -> ece7c4d)

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

tarmstrong pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git.


    from fdde669  IMPALA-8897 (part 2): Fix javascript to work with Knox integration
     new eb680e4  IMPALA-5802: use mt scan node for all formats
     new ece7c4d  IMPALA-8923: remove synchronized in HBaseTable.getEstimatedRowStats

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 be/src/exec/exec-node.cc                           | 11 ++---
 be/src/exec/hdfs-scan-node-mt.cc                   | 11 -----
 .../org/apache/impala/catalog/FeHBaseTable.java    | 39 ++++++++++------
 .../java/org/apache/impala/catalog/HBaseTable.java |  2 +-
 .../org/apache/impala/planner/HdfsScanNode.java    | 14 +-----
 .../java/org/apache/impala/planner/Planner.java    |  3 --
 .../queries/PlannerTest/resource-requirements.test | 52 +++++-----------------
 7 files changed, 43 insertions(+), 89 deletions(-)


[impala] 01/02: IMPALA-5802: use mt scan node for all formats

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit eb680e4633256562f1a1a33feec5005e8fc60e2f
Author: Tim Armstrong <ta...@cloudera.com>
AuthorDate: Thu Aug 29 22:39:52 2019 -0700

    IMPALA-5802: use mt scan node for all formats
    
    This remove special-casing of the sequence-based
    file formats (Avro, RC, Seq) where they used the
    legacy scan node instead of the multi-threaded
    scan node when mt_dop was enabled.
    
    There was no particular reason to do this: the
    code path are all already in use and should be more
    resource-efficient with multithreading enabled.
    
    Testing:
    Updated planner tests to reflect that MT scan
    is used. Removed PARALLELPLANS for the Hive
    3 Avro test because it does not provide
    important coverage and required updating.
    
    Performance:
    Some targeted benchmarks showed no difference in
    performance.
    
    Query:
    set mt_dop=4; select min(l_orderkey), min(l_comment) from lineitem;
    
    tpch_avro Before: 0.51 0.41 0.51 0.41 0.51
    tpch_avro After: 0.41 0.41 0.41 0.41 0.41
    tpch_rc Before: 0.31 0.31 0.31 0.31 0.31
    tpch_rc After: 0.31 0.31 0.31 0.31 0.31
    tpch_seq_gzip Before: 2.32 2.22 2.22 2.22 2.32
    tpch_seq_gzip After: 2.22 2.22 2.22 2.32 2.32
    
    Query:
    unset mt_dop; compute stats lineitem;
    
    tpch_avro Before: 1.21 1.21 1.21 1.21 1.21
    tpch_avro After: 1.21 1.31 1.21 1.31 1.21
    tpch_rc Before: 1.31 1.41 1.31 1.31 1.31
    tpch_rc After: 1.31 1.41 1.31 1.31 1.31
    tpch_seq_gzip Before: 2.82 2.72 2.71 2.92 2.71
    tpch_seq_gzip After: 2.82 2.82 2.81 2.71 2.92
    
    Change-Id: I8a91d2e5c2ebb617b7643cd676cb3490c190a68a
    Reviewed-on: http://gerrit.cloudera.org:8080/14171
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/exec/exec-node.cc                           | 11 ++---
 be/src/exec/hdfs-scan-node-mt.cc                   | 11 -----
 .../org/apache/impala/planner/HdfsScanNode.java    | 14 +-----
 .../java/org/apache/impala/planner/Planner.java    |  3 --
 .../queries/PlannerTest/resource-requirements.test | 52 +++++-----------------
 5 files changed, 17 insertions(+), 74 deletions(-)

diff --git a/be/src/exec/exec-node.cc b/be/src/exec/exec-node.cc
index 45a38c3..e4a851f 100644
--- a/be/src/exec/exec-node.cc
+++ b/be/src/exec/exec-node.cc
@@ -249,14 +249,9 @@ Status ExecNode::CreateNode(ObjectPool* pool, const TPlanNode& tnode,
   stringstream error_msg;
   switch (tnode.node_type) {
     case TPlanNodeType::HDFS_SCAN_NODE:
-      if (tnode.hdfs_scan_node.use_mt_scan_node) {
-        DCHECK_GT(state->query_options().mt_dop, 0);
-        *node = pool->Add(new HdfsScanNodeMt(pool, tnode, descs));
-      } else {
-        DCHECK(state->query_options().mt_dop == 0
-            || state->query_options().num_scanner_threads == 1);
-        *node = pool->Add(new HdfsScanNode(pool, tnode, descs));
-      }
+      *node = pool->Add(tnode.hdfs_scan_node.use_mt_scan_node ?
+              static_cast<HdfsScanNodeBase*>(new HdfsScanNodeMt(pool, tnode, descs)) :
+              static_cast<HdfsScanNodeBase*>(new HdfsScanNode(pool, tnode, descs)));
       break;
     case TPlanNodeType::HBASE_SCAN_NODE:
       *node = pool->Add(new HBaseScanNode(pool, tnode, descs));
diff --git a/be/src/exec/hdfs-scan-node-mt.cc b/be/src/exec/hdfs-scan-node-mt.cc
index 7a42e3f..63f0b80 100644
--- a/be/src/exec/hdfs-scan-node-mt.cc
+++ b/be/src/exec/hdfs-scan-node-mt.cc
@@ -45,17 +45,6 @@ HdfsScanNodeMt::~HdfsScanNodeMt() {
 
 Status HdfsScanNodeMt::Prepare(RuntimeState* state) {
   RETURN_IF_ERROR(HdfsScanNodeBase::Prepare(state));
-  // Return an error if this scan node has been assigned a range that is not supported
-  // because the scanner of the corresponding file format does implement GetNext().
-  for (const auto& files: per_type_files_) {
-    if (!files.second.empty() && files.first != THdfsFileFormat::PARQUET
-        && files.first != THdfsFileFormat::ORC
-        && files.first != THdfsFileFormat::TEXT) {
-      stringstream msg;
-      msg << "Unsupported file format with HdfsScanNodeMt: " << files.first;
-      return Status(msg.str());
-    }
-  }
   return Status::OK();
 }
 
diff --git a/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java b/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
index df93e5e..a282a49 100644
--- a/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/HdfsScanNode.java
@@ -412,18 +412,8 @@ public class HdfsScanNode extends ScanNode {
     // compute scan range locations with optional sampling
     computeScanRangeLocations(analyzer);
 
-    // Determine backend scan node implementation to use. The optimized MT implementation
-    // is currently supported for Parquet, ORC and Text.
-    if (analyzer.getQueryOptions().isSetMt_dop() &&
-        analyzer.getQueryOptions().mt_dop > 0 &&
-        fileFormats_.size() == 1 &&
-        (fileFormats_.contains(HdfsFileFormat.PARQUET)
-          || fileFormats_.contains(HdfsFileFormat.ORC)
-          || fileFormats_.contains(HdfsFileFormat.TEXT))) {
-      useMtScanNode_ = true;
-    } else {
-      useMtScanNode_ = false;
-    }
+    useMtScanNode_ =
+        analyzer.getQueryOptions().isSetMt_dop() && analyzer.getQueryOptions().mt_dop > 0;
 
     if (fileFormats_.contains(HdfsFileFormat.PARQUET)) {
       // Compute min-max conjuncts only if the PARQUET_READ_STATISTICS query option is
diff --git a/fe/src/main/java/org/apache/impala/planner/Planner.java b/fe/src/main/java/org/apache/impala/planner/Planner.java
index 6854f73..d6989cd 100644
--- a/fe/src/main/java/org/apache/impala/planner/Planner.java
+++ b/fe/src/main/java/org/apache/impala/planner/Planner.java
@@ -255,9 +255,6 @@ public class Planner {
     } else {
       parallelPlans = Collections.singletonList(distrPlan.get(0));
     }
-    // Only use one scanner thread per scan-node instance since intra-node
-    // parallelism is achieved via multiple fragment instances.
-    ctx_.getQueryOptions().setNum_scanner_threads(1);
     ctx_.getTimeline().markEvent("Parallel plans created");
     return parallelPlans;
   }
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test b/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
index 25abffb..cd0c49a 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/resource-requirements.test
@@ -1143,7 +1143,7 @@ Per-Host Resources: mem-estimate=88.00MB mem-reservation=8.00MB thread-reservati
    tuple-ids=0 row-size=88B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=16.00MB Threads=5
+Max Per-Host Resource Reservation: Memory=16.00MB Threads=3
 Per-Host Resource Estimates: Memory=176MB
 WARNING: The following tables are missing relevant table and/or column statistics.
 tpch_avro.orders
@@ -1160,14 +1160,14 @@ PLAN-ROOT SINK
 |  in pipelines: 00(GETNEXT)
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=4
-Per-Host Resources: mem-estimate=176.00MB mem-reservation=16.00MB thread-reservation=4
+Per-Host Resources: mem-estimate=176.00MB mem-reservation=16.00MB thread-reservation=2
 00:SCAN HDFS [tpch_avro.orders, RANDOM]
    partitions=1/1 files=2 size=156.92MB
    stored statistics:
      table: rows=unavailable size=156.92MB
      columns: unavailable
    extrapolated-rows=disabled max-scan-range-rows=unavailable
-   mem-estimate=88.00MB mem-reservation=8.00MB thread-reservation=1
+   mem-estimate=88.00MB mem-reservation=8.00MB thread-reservation=0
    tuple-ids=0 row-size=88B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ====
@@ -1224,34 +1224,6 @@ Per-Host Resources: mem-estimate=64.00MB mem-reservation=8.00MB thread-reservati
    mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
    tuple-ids=0 row-size=88B cardinality=unavailable
    in pipelines: 00(GETNEXT)
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=16.00MB Threads=5
-Per-Host Resource Estimates: Memory=129MB
-WARNING: The following tables are missing relevant table and/or column statistics.
-tpch_avro.orders
-Analyzed query: SELECT * FROM tpch_avro.orders
-
-F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
-|  Per-Host Resources: mem-estimate=551.97KB mem-reservation=0B thread-reservation=1
-PLAN-ROOT SINK
-|  mem-estimate=0B mem-reservation=0B thread-reservation=0
-|
-01:EXCHANGE [UNPARTITIONED]
-|  mem-estimate=551.97KB mem-reservation=0B thread-reservation=0
-|  tuple-ids=0 row-size=88B cardinality=unavailable
-|  in pipelines: 00(GETNEXT)
-|
-F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
-Per-Host Resources: mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=4
-00:SCAN HDFS [tpch_avro.orders, RANDOM]
-   HDFS partitions=1/1 files=3 size=156.92MB
-   stored statistics:
-     table: rows=unavailable size=156.92MB
-     columns: unavailable
-   extrapolated-rows=disabled max-scan-range-rows=unavailable
-   mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
-   tuple-ids=0 row-size=88B cardinality=unavailable
-   in pipelines: 00(GETNEXT)
 ====
 # RC scan.
 select * from tpch_rc.customer
@@ -1305,7 +1277,7 @@ Per-Host Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservati
    tuple-ids=0 row-size=78B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=16.00MB Threads=5
+Max Per-Host Resource Reservation: Memory=16.00MB Threads=3
 Per-Host Resource Estimates: Memory=64MB
 WARNING: The following tables are missing relevant table and/or column statistics.
 tpch_rc.customer
@@ -1322,14 +1294,14 @@ PLAN-ROOT SINK
 |  in pipelines: 00(GETNEXT)
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=2
-Per-Host Resources: mem-estimate=64.00MB mem-reservation=16.00MB thread-reservation=4
+Per-Host Resources: mem-estimate=64.00MB mem-reservation=16.00MB thread-reservation=2
 00:SCAN HDFS [tpch_rc.customer, RANDOM]
    partitions=1/1 files=1 size=22.47MB
    stored statistics:
      table: rows=unavailable size=22.47MB
      columns: unavailable
    extrapolated-rows=disabled max-scan-range-rows=unavailable
-   mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+   mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
    tuple-ids=0 row-size=78B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ====
@@ -1385,7 +1357,7 @@ Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservati
    tuple-ids=0 row-size=104B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=16.00MB Threads=5
+Max Per-Host Resource Reservation: Memory=16.00MB Threads=3
 Per-Host Resource Estimates: Memory=32MB
 WARNING: The following tables are missing relevant table and/or column statistics.
 tpcds_seq_snap.web_returns
@@ -1402,14 +1374,14 @@ PLAN-ROOT SINK
 |  in pipelines: 00(GETNEXT)
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=2
-Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=4
+Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=2
 00:SCAN HDFS [tpcds_seq_snap.web_returns, RANDOM]
    partitions=1/1 files=1 size=6.61MB
    stored statistics:
      table: rows=unavailable size=6.61MB
      columns: unavailable
    extrapolated-rows=disabled max-scan-range-rows=unavailable
-   mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+   mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
    tuple-ids=0 row-size=104B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ====
@@ -1591,7 +1563,7 @@ Per-Host Resources: mem-estimate=16.00MB mem-reservation=88.00KB thread-reservat
    tuple-ids=0 row-size=80B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ---- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=176.00KB Threads=5
+Max Per-Host Resource Reservation: Memory=176.00KB Threads=3
 Per-Host Resource Estimates: Memory=32MB
 WARNING: The following tables are missing relevant table and/or column statistics.
 functional.alltypesmixedformat
@@ -1608,7 +1580,7 @@ PLAN-ROOT SINK
 |  in pipelines: 00(GETNEXT)
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
-Per-Host Resources: mem-estimate=32.00MB mem-reservation=176.00KB thread-reservation=4
+Per-Host Resources: mem-estimate=32.00MB mem-reservation=176.00KB thread-reservation=2
 00:SCAN HDFS [functional.alltypesmixedformat, RANDOM]
    partitions=4/4 files=4 size=66.12KB
    stored statistics:
@@ -1616,7 +1588,7 @@ Per-Host Resources: mem-estimate=32.00MB mem-reservation=176.00KB thread-reserva
      partitions: 0/4 rows=unavailable
      columns missing stats: id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col
    extrapolated-rows=disabled max-scan-range-rows=unavailable
-   mem-estimate=16.00MB mem-reservation=88.00KB thread-reservation=1
+   mem-estimate=16.00MB mem-reservation=88.00KB thread-reservation=0
    tuple-ids=0 row-size=80B cardinality=unavailable
    in pipelines: 00(GETNEXT)
 ====


[impala] 02/02: IMPALA-8923: remove synchronized in HBaseTable.getEstimatedRowStats

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ece7c4d77ce387fba26e841c8bddd5dc08bcacc0
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Fri Sep 6 06:41:40 2019 -0700

    IMPALA-8923: remove synchronized in HBaseTable.getEstimatedRowStats
    
    HBaseTable.getEstimatedRowStats() estimates #rows and row size by
    sampling on hbase table in target key range. It requires HBase RPCs
    so could be slow.
    
    Currently, HBaseTable.getEstimatedRowStats() is marked as synchronized.
    The purpose is to protect the HTable (old HBase API) object in legacy
    codes (before commit cf9d2485dd4e6544f6f1f407e2ad0b43eba31874). However,
    after commit cf9d248, we create org.apache.hadoop.hbase.client.Table
    object for each task (See comments and usages of getHBaseTable() in
    FeHBaseTable.Util). So we don't need the "synchronized" keyword anymore
    in HBaseTable.getEstimatedRowStats().
    
    Keeping this method "synchronized" is further harmful. In high qps
    workload, queries on the same table will wait for entering this method
    and cost a lot of time in waiting (if this method is comparably slow).
    
    Added some useful tracing logs to detect slow HBase RPCs.
    
    Tests:
     - Manually adding a 100ms latency (e.g. 100ms) in
     FeHBaseTable.Util.getEstimatedRowStats() and run concurrent queries on
     the same hbase table. In my experiment, removing "synchronized" gains
     40% boost in 95% percentile query time.
    
    Change-Id: Ifa23c16ee662c4f22851c700aea2ea5be847b64d
    Reviewed-on: http://gerrit.cloudera.org:8080/14188
    Reviewed-by: Quanlong Huang <hu...@gmail.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 .../org/apache/impala/catalog/FeHBaseTable.java    | 39 ++++++++++++++--------
 .../java/org/apache/impala/catalog/HBaseTable.java |  2 +-
 2 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/fe/src/main/java/org/apache/impala/catalog/FeHBaseTable.java b/fe/src/main/java/org/apache/impala/catalog/FeHBaseTable.java
index f2449ff..d97492f 100644
--- a/fe/src/main/java/org/apache/impala/catalog/FeHBaseTable.java
+++ b/fe/src/main/java/org/apache/impala/catalog/FeHBaseTable.java
@@ -55,7 +55,8 @@ import org.apache.impala.thrift.TResultSet;
 import org.apache.impala.thrift.TResultSetMetadata;
 import org.apache.impala.util.StatsHelper;
 import org.apache.impala.util.TResultRowBuilder;
-import org.apache.log4j.Logger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
@@ -98,7 +99,7 @@ public interface FeHBaseTable extends FeTable {
     static final int ROW_COUNT_ESTIMATE_BATCH_SIZE = 10;
     // Keep the conf around
     static final Configuration HBASE_CONF = HBaseConfiguration.create();
-    private static final Logger LOG = Logger.getLogger(FeHBaseTable.class);
+    private static final Logger LOG = LoggerFactory.getLogger(FeHBaseTable.class);
     // Maximum deviation from the average to stop querying more regions
     // to estimate the row count
     private static final double DELTA_FROM_AVERAGE = 0.15;
@@ -354,10 +355,6 @@ public interface FeHBaseTable extends FeTable {
      * <p>
      * Currently, the algorithm does not consider the case that the key range used as a
      * parameter might be generally of different size than the rest of the region.
-     * <p>
-     * The values computed here should be cached so that in high qps workloads
-     * the nn is not overwhelmed. Could be done in load(); Synchronized to make
-     * sure that only one thread at a time is using the htable.
      *
      * @param startRowKey First row key in the range
      * @param endRowKey   Last row key in the range
@@ -369,6 +366,12 @@ public interface FeHBaseTable extends FeTable {
       Preconditions.checkNotNull(startRowKey);
       Preconditions.checkNotNull(endRowKey);
 
+      if (LOG.isTraceEnabled()) {
+        LOG.trace("getEstimatedRowStats for {} for key range ('{}', '{}')",
+            tbl.getHBaseTableName(), Bytes.toString(startRowKey),
+            Bytes.toString(endRowKey));
+      }
+      long startTime = System.currentTimeMillis();
       boolean isCompressed = false;
       long rowCount;
       long rowSize;
@@ -406,10 +409,10 @@ public interface FeHBaseTable extends FeTable {
           totalEstimatedRows += tmp.first;
           statsSize.addSample(tmp.second);
           if (LOG.isTraceEnabled()) {
-            LOG.trace(String.format("Estimation state: totalEstimatedRows=%d, " +
-                    "statsSize.count=%d, statsSize.stddev=%f, statsSize.mean=%f",
+            LOG.trace("Estimation state: totalEstimatedRows={}, statsSize.count={}, " +
+                    "statsSize.stddev={}, statsSize.mean={}",
                 totalEstimatedRows, statsSize.count(), statsSize.stddev(),
-                statsSize.mean()));
+                statsSize.mean());
           }
         }
 
@@ -424,16 +427,19 @@ public interface FeHBaseTable extends FeTable {
           // No meaningful row width found. The < 1 handles both the
           // no row case and the potential case where the average is
           // too small to be meaningful.
-          LOG.warn(String.format("Table %s: no data available to compute " +
-              "row count estimate for key range ('%s', '%s')",
-              tbl.getFullName(),
-              new String(startRowKey, Charsets.UTF_8),
-              new String(endRowKey, Charsets.UTF_8)));
+          LOG.warn("Table {}: no data available to compute " +
+              "row count estimate for key range ('{}', '{}')",
+              tbl.getFullName(), Bytes.toString(startRowKey), Bytes.toString(endRowKey));
           return new Pair<>(-1L, -1L);
         } else {
           rowCount = (long) (totalSize / statsSize.mean());
         }
         rowSize = (long) statsSize.mean();
+        if (LOG.isTraceEnabled()) {
+          LOG.trace("getEstimatedRowStats results: rowCount={}, rowSize={}, " +
+              "timeElapsed={}ms", rowCount, rowSize,
+              System.currentTimeMillis() - startTime);
+        }
         return new Pair<>(rowCount, rowSize);
       } catch (IOException ioe) {
         // Print the stack trace, but we'll ignore it
@@ -644,6 +650,7 @@ public interface FeHBaseTable extends FeTable {
      */
     public static List<HRegionLocation> getRegionsInRange(FeHBaseTable tbl,
         final byte[] startKey, final byte[] endKey) throws IOException {
+      long startTime = System.currentTimeMillis();
       try (org.apache.hadoop.hbase.client.Table hbaseTbl = getHBaseTable(tbl)) {
         final boolean endKeyIsEndOfTable = Bytes.equals(endKey, HConstants.EMPTY_END_ROW);
         if ((Bytes.compareTo(startKey, endKey) > 0) && !endKeyIsEndOfTable) {
@@ -662,6 +669,10 @@ public interface FeHBaseTable extends FeTable {
           currentKey = regionLocation.getRegionInfo().getEndKey();
         } while (!Bytes.equals(currentKey, HConstants.EMPTY_END_ROW) &&
             (endKeyIsEndOfTable || Bytes.compareTo(currentKey, endKey) < 0));
+        if (LOG.isTraceEnabled()) {
+          LOG.trace("getRegionsInRange timeElapsed={}ms",
+              System.currentTimeMillis() - startTime);
+        }
         return regionList;
       }
     }
diff --git a/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java b/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java
index d75afa7..5e7280f 100644
--- a/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java
+++ b/fe/src/main/java/org/apache/impala/catalog/HBaseTable.java
@@ -138,7 +138,7 @@ public class HBaseTable extends Table implements FeHBaseTable {
   }
 
   @Override
-  public synchronized Pair<Long, Long> getEstimatedRowStats(byte[] startRowKey,
+  public Pair<Long, Long> getEstimatedRowStats(byte[] startRowKey,
       byte[] endRowKey) {
     return Util.getEstimatedRowStats(this, startRowKey, endRowKey);
   }