SlideShare a Scribd company logo
1 of 60
Download to read offline
How to use Impala query plan and profile to
fix performance issues
Juan Yu
Impala Field Engineer, Cloudera
Profiles?! Explain plans!? Arggghh…
§ For the end user, understanding Impala performance is like…
- Lots of commonality between requests, e.g.
- What’s the bottleneck for this query?
- Why this run is fast but that run is slow?
- How can I tune to improve this query’s performance.
Agenda
- What are query plan and profile
- What kind of issues query plan and profile can help you solve
- Structure of query plan and profile
- Basic troubleshooting
- Advanced query tuning and troubleshooting
Why did the following queries take different time?
SELECT AVG(ss_list_price) FROM
store_sales WHERE ss_sold_date_sk
BETWEEN 2451959 AND 2451989;
Fetched 1 row(s) in 0.28s
SELECT AVG(ss_list_price) FROM
store_sales;
Fetched 1 row(s) in 3.60s
Partition Pruning
reduces scan work
and intermediate
result.
Where to get Query plan and profile
- Cloudera Manager Query history page
- Impala webUI queries page
- Impala-shell
- Profile examples: https://github.com/yjwater/strata-sj
Query Planning: Goals
- Lower execution cost and get better performance
- Reduce unnecessary work as much as possible by partition pruning, predicate
pushdown, runtime filter,etc.
- Maximize scan locality using DN block metadata.
- Minimize data movement (optimize join order, choose better join strategy)
- Parallel tasks and run them on many nodes to shorten execution time.
Query profile - Execution Results
- Provide metrics and counters to show
- how execution is ongoing.
- how much resources are used.
- how long each piece takes.
- Is there any bottleneck and/or abnormal behavior.
What issues query plan and profile can help you solve?
§ Plan:
- Missing stats
- Partition pruning
- Predicate pushdown
- Join order
- Join strategy
- Parallelism
§ Profile:
- Identify Bottleneck
- Runtime filter effectiveness
- Memory usage/Spill to disk
- Network slowness
- Skew
- Client side issues
- Metadata loading
Flow of a SQL Query
Compile Query
Execute Query
Client
Client
SQL Text
Executable Plan
Query Results
Impala Frontend
(Java)
Impala Backend
(C++)
Query Profile
Impala - Logical view
Query Compiler
Query Executor
Query Coordinator
Metadata
HDFS Kudu S3/ADLS HBase
Query Compiler
Query Executor
Query Coordinator
Metadata
Query Compiler
Query Executor
Query Coordinator
Metadata
Hive Metastore
HDFS
NameNode
StateStore Catalog
FE
(Java)
BE (C++)
HDFS Kudu S3/ADLS HBase HDFS Kudu S3/ADLS HBase
Metadata
Impalad Impalad Impalad
Metadata/control	
Execution
Storage
Sentry
Role: admin, Privs: R/W access on ALL
Role: user, Privs: R access on TABLE db1.foo,
...
Dir: hdfs://db1/foo, File: foo1.csv, Blocks:...., Size:
100B
Dir: S3://bucket/db2/blah, File: blah1.parq, Size: 1GB
DB: db1, Tbl: foo (a int,...) location ‘hdfs://…’
DB: db2, Tbl: blah (b string..) location ‘s3://…’
Impala in action - Select query
Query Compiler
Query Executor
Query Coordinator
Metadata
HDFS Kudu S3/ADLS HBase
Query Compiler
Query Executor
Query Coordinator
Metadata
Query Compiler
Query Executor
Query Coordinator
Metadata
Hive Metastore
HDFS
NameNode
StateStore Catalog
HDFS Kudu S3/ADLS HBase HDFS Kudu S3/ADLS HBase
Metadata
Impalad Impalad Impalad
SQL App
ODBC/JDBC
select * from
db.foo;
0
1
2
34
5
6
7
Query Planning
- Single-Node Plan (SET NUM_NODES=1):
- Assigns predicates to lowest plan node.
- Prunes irrelevant columns and partitions (if applicable).
- Optimizes join order.
- Determine effective runtime filters
- Distributed Plan:
- Provides list of best Impalads to do the scan work.
- Picks an execution strategy for each join (broadcast vs hash-partitioned)
- Introduces exchange operators and groups nodes in plan fragments (unit of work).
Compile query
HashJoin
Scan: t1
Scan: t3
Scan: t2
HashJoin
TopN
Agg
SELECT t1.dept, SUM(t2.revenue)
FROM LargeHdfsTable t1
JOIN SmallHdfsTable t2 ON (t1.id1 = t2.id)
JOIN LargeHbaseTable t3 ON (t1.id2 = t3.id)
WHERE t3.category = 'Online‘ AND t1.id > 10
GROUP BY t1.dept
HAVING COUNT(t2.revenue) > 10
ORDER BY revenue LIMIT 10
Hint: set num_nodes=1; to explain the single node plan
HashJoin
Scan: t1
Scan: t3
Scan: t2
HashJoin
TopN
Agg
Single-Node
Plan
HashJoin
Scan: t1
Scan: t3
Scan: t2
HashJoin
TopN
Pre-Agg
Exchange
Exchange
Exchange
Exchange
Merge-Agg
ExchangeTopN
Distributed Plan
This is what EXPLAIN
shows by default
Single to Distributed Node Plan
HashJoin
Scan: t1
Scan: t3
Scan: t2
HashJoin
TopN
Pre-Agg
Exchange
Exchange
Exchange
Exchange
Merge-Agg
ExchangeTopN
PlanFragment
execution model subject to change
Plan Fragmentation
HashJoin
Scan: t1
Scan: t3
Scan: t2
HashJoin
TopN
Agg
Single-Node
Plan Distributed Plan
Query Plan Visualization
select c_name, c_custkey, o_orderkey, o_orderdate,
o_totalprice, sum(l_quantity)
from customer, orders, lineitem
where o_orderkey in (
select l_orderkey
from lineitem
group by l_orderkey
having sum(l_quantity) > 300 )
and c_custkey = o_custkey
and o_orderkey = l_orderkey
group by c_name, c_custkey, o_orderkey, o_orderdate,
o_totalprice
order by o_totalprice desc, o_orderdate
limit 100
F3,	instance	0
Query Execution
node	1 node	2
coordinator
F1,	instance	0
SCAN	
t2
F2,	instance	0
HASH	
JOIN
F0,	instance	0
SCAN	
t1
F2,	instance	1
HASH	
JOIN
F0,	instance	1
SCAN	
t1
F1,	instance1	
SCAN	
t2
Legend
Plan
Fragment
Fragment
Instance
F2,	instance	0
HASH	
JOIN
Operator
Exchanges 03, 04
Exchange 05
Ø explain SELECT * FROM t1 JOIN [shuffle] t2 ON
t1.id = t2.id;
+-----------------------------------------------------------+
| Explain String |
+-----------------------------------------------------------+
| Estimated Per-Host Requirements: Memory=240.00MB VCores=2 |
| |
| 05:EXCHANGE [UNPARTITIONED] |
| | |
| 02:HASH JOIN [INNER JOIN, PARTITIONED] |
| | hash predicates: t1.id = t2.id |
| | |
| |--04:EXCHANGE [HASH(t2.id)] |
| | | |
| | 01:SCAN HDFS [functional.alltypestiny t2] |
| | partitions=4/4 files=4 size=460B |
| | |
| 03:EXCHANGE [HASH(t1.id)] |
| | |
| 00:SCAN HDFS [functional.alltypes t1] |
| partitions=24/24 files=24 size=478.45KB |
+-----------------------------------------------------------+
Plan and Profile structure
Query Summary
|- Basic info: state, type, user, statement, coordinator
|- Query plan
|- Execution summary
|- Timeline
Client side info
Execution details
|- Runtime Filter table
|- Coordinator Fragment
|- Instance
|- Operator node A
…
|- Average Fragment 3
|- Fragment instance 0
|- Operator node B
...
|- Fragment instance 1
...
|- Average Fragment 2
|- Average Fragment 0
explain_level = 3
Basic Query information
Query (id=5349daec57a4d786:9536a60900000000):
Summary:
Session ID: 5245f03b5b3c17ec:1dbd50ff83471f95
Session Type: HIVESERVER2
HiveServer2 Protocol Version: V6
Start Time: 2018-02-09 13:17:31.162274000
End Time: 2018-02-09 13:20:05.281900000
Query Type: QUERY
Query State: FINISHED
Query Status: OK
Impala Version: impalad version 2.11.0-cdh5.14.0
User: REDACTED
Connected User: REDACTED
Delegated User:
Network Address: REDACTED:54129
Default Db: tpch_100_parquet
Sql Statement: select * from lineitems limit 100
Coordinator: REDACTED:22000
Query Options (set by configuration): ABORT_ON_ERROR=1,MEM_LIMIT=5658116096
Query Options (set by configuration and planner): ABORT_ON_ERROR=1,MEM_LIMIT=5658116096,MT_DOP=0
Look into the Timeline
Planner Timeline: 218.105ms
- Analysis finished: 159.486ms (159.486ms)
- Value transfer graph computed: 159.522ms (35.958us)
- Single node plan created: 162.606ms (3.083ms)
- Runtime filters computed: 162.869ms (262.984us)
- Distributed plan created: 162.908ms (39.628us)
- Lineage info computed: 163.006ms (97.845us)
- Planning finished: 218.105ms (55.098ms)
Query Timeline: 2m34s
- Query submitted: 12.693ms (12.693ms)
- Planning finished: 350.339ms (337.646ms)
- Submit for admission: 422.437ms (72.097ms)
- Completed admission: 433.900ms (11.462ms)
- Ready to start on 8 backends: 648.182ms (214.282ms)
- All 8 execution backends (47 fragment instances) started: 5s683ms (5s035ms)
- First dynamic filter received: 1m50s (1m44s)
- Rows available: 2m32s (41s835ms)
- First row fetched: 2m32s (447.280ms)
- Unregister query: 2m34s (1s232ms)
Client side
- Avoid large data extract.
- It’s usually not a good idea to dump lots of data out using JDBC/ODBC.
- For Impala-shell, use the –B option to fetch lots of data.
Total	query	time
Idle	time:	client	isn’t	fetching
ExecSummary
ExecSummary – Find Bottlenecks
- Use ExecSummary from Query Profile to identify bottlenecks
ExecSummary – Find Skew
- Use ExecSummary from Query Profile to identify skew
- Max Time is significantly more than Avg Time => Skew!
Exercises
- Predicate pushdown
- Remote read
- Codegen
- Planning time
- DDLs
Advanced Query Tuning and Troubleshooting
Advanced Query Tuning
- Common issues
- Query succeeds but very slow
- Query fails with OOM error
-
- How to address them
- Examine the logic of the query and validate the Explain Plan
- Use Query Profile to identify bottlenecks.
Performance analysis – Example 1
§ Fix: Compute stats <table>
Corrupted
stats
| Estimated Per-Host Requirements: Memory=84.76GB VCores=3 |
| WARNING: The following tables are missing relevant table and/or column statistics. |
| tpcds500gb_parquet.date_dim, tpcds500gb_parquet.store_sales, tpcds500gb_parquet.item |
|
| 04:HASH JOIN [INNER JOIN, BROADCAST] |
| | hash predicates: store_sales.ss_item_sk = item.i_item_sk |
| | |
| |--08:EXCHANGE [BROADCAST] |
| | | |
| | 02:SCAN HDFS [tpcds500gb_parquet.item] |
| | partitions=1/1 size=3.14MB |
| | predicates: item.i_manager_id = 1 |
| | |
| 03:HASH JOIN [INNER JOIN, BROADCAST] |
| | hash predicates: dt.d_date_sk = store_sales.ss_sold_date_sk |
| | |
| |--07:EXCHANGE [BROADCAST] |
| | | |
| | 01:SCAN HDFS [tpcds500gb_parquet.store_sales] |
| | partitions=1823/1823 size=180.21GB |
| | |
| 00:SCAN HDFS [tpcds500gb_parquet.date_dim dt] |
| partitions=1/1 size=2.41MB |
| predicates: dt.d_moy = 12, dt.d_year = 1998 |
+-------------------------------------------------------------------------------------------------------+
Missing
stats
Performance analysis – Example 2
Performance analysis – Example 2 (good plan)
…
|
| |--07:EXCHANGE [BROADCAST] |
| | | hosts=3 per-host-mem=0B |
| | | tuple-ids=0 row-size=16B cardinality=29 |
| | | |
| | 00:SCAN HDFS [tpcds500gb_parquet.date_dim dt, RANDOM] |
| | partitions=1/1 size=2.41MB |
| | predicates: dt.d_moy = 12, dt.d_year = 1998 |
| | table stats: 73049 rows total |
| | column stats: all |
| | hosts=3 per-host-mem=48.00MB |
| | tuple-ids=0 row-size=16B cardinality=29 |
| | |
| 01:SCAN HDFS [tpcds500gb_parquet.store_sales, RANDOM] |
| partitions=1823/1823 size=180.21GB |
| table stats: 4125561494 rows total |
| column stats: all |
| hosts=10 per-host-mem=176.00MB |
| tuple-ids=1 row-size=20B cardinality=4125561494 |
+-------------------------------------------------------------------------------------------------------+
set explain_level=3;
set num_nodes=0;
Query Tuning Basics - Join
§ Validate join order and join strategy
- Optimal Join Order
- RHS should be smaller than LHS
- Minimize intermediate results
- Strategy – Broadcast vs. Partitioned
- Network costs (partition and send lhs+rhs or broadcast rhs)
- Memory costs
- RHS must fit in memory!
Join-Order Optimization
SELECT … FROM T1, T2, T3, T4
WHERE T1.id = T2.id AND T2.id = T3.id AND T3.id = T4.id;
T1
T2
T3
T4
HJ
HJ
HJ
Use of Statistics during Plan Generation
- Table statistics: Number of rows per partition/table.
- Column statistics: Number of distinct values per column.
- Use of table and column statistics
- Estimate selectivity of predicates (esp. scan predicates like “month=10”).
- Estimate selectivity of joins à join cardinality (#rows)
- Heuristic FK/PK detection.
- Pick distributed join strategy: broadcast vs. partitioned
- Join inputs have very different size à broadcast small side.
- Join inputs have roughly equal size à partitioned.
Join Execution Strategy
§ Broadcast Join § Repartition Join
A join B
A join B
A join B
Scan and
Broadcast
Table B
A join B
A join B
A join B
Scan and repartition both
tables according to join keys
Local
scan for
Table A
Join Strategy – what’s the cost
- Impala choses the right strategy based on stats (collect stats!)
- Use the join strategy that minimizes data transfer
- Use explain plan to see the data size
- Join Hint: [shuffle] or [broadcast]
Join strategy cost Network Traffic Memory Usage
(HashTable)
Broadcast Join RHS table size1 x
number of node
RHS table size1
x number of node
Partitioned Join LHS + RHS table size1 RHS table size1
1 table size refers to the data flowed from the child node (i.e. only required column data after filtering counts).
Join - Exercise
§ TPCH 100GB data on 8-node cluster
- Table1: lineitem. cardinality=600M, row size ~ 260B
- Table2: orders. cardinality=150M, row size ~ 200B
- orderkey is bigint.
§ For the following query, what’s the optimal join order and join strategy.
- SELECT count(*) FROM lineitem JOIN orders ON l_orderkey = o_orderkey;
- SELECT lineitem.* FROM lineitem JOIN orders ON l_orderkey = o_orderkey;
- SELECT orders.* FROM lineitem JOIN orders ON l_orderkey = o_orderkey;
§ How about on a 100-node cluster?
Runtime Filter - Check how selective the join is
Large	hash	join	output	(~2.8B),	
the	output	of	upstream	one	is	
much	smaller	(32M,	reduced	to	
only	~1%).	This	indicates	runtime	
filter	can	be	helpful.
1
2
3
4
RF002	<- d.d_date_sk
Filter	coming	from	Exch	
Node	20,	Applied	to	Scan	
Node	02,	reduce	scan	
output	from	2.8B to	32M
and	all	the	upstream	hash	
join	as	well.
RF001	<- (d_month_seq)
Filter	coming	from	Scan	
Node	05,	Applied	to	Scan	
Node	03,	Reduce	scan	
output	from		73049 to	31
Why Runtime Filter doesn’t work sometimes?
Filter	doesn‘t	take	effect	because	scan	was	
short	and	finished	before	filter	arrived.
HDFS_SCAN_NODE	(id=3):
Filter	1	(1.00	MB):
- Rows	processed:	16.38K	(16383)
- Rows	rejected:	0	(0)
- Rows	total:	16.38K	(16384)
How to tune it?
- Increase RUNTIME_FILTER_WAIT_TIME_MS to 5000ms to let Scan Node 03
wait longer time for the filter.
HDFS_SCAN_NODE	(id=3)
Filter	1	(1.00	MB)
- InactiveTotalTime:	0
- Rows	processed:	73049
- Rows	rejected:	73018
- Rows	total:	73049
- TotalTime:	0
- If the cluster is relatively busy, consider increasing the wait time too so that
complicated queries do not miss opportunities for optimization.
Runtime filter profile examples
- Profile walkthrough
- Effective vs Non-Effective
- Local vs Global
- Filter Wait Time
- Filter Memory Usage
Memory
§ Planner estimation
42
§ Actual usage from profile
§ Metrics per node
Memory - OOM
Memory – Insert strategy
§ Non-shuffle § Shuffle
Node A
Partition data 1, 3, 5, 6
Node B
Partition data 2, 3, 6, 7
Node C
Partition data 3, 4, 8
Node D
Partition data 1, 4, 7, 8
4 writers
4 writers
3 writers
4 writers
Node A
Partition data 1, 5
Node B
Partition data 2, 6
Node C
Partition data 3, 7
Node D
Partition data 4, 8
2 writers
2 writers
2 writers
2 writers
Memory – Group By
§ SELECT product, count(1), sold_date FROM sales_history GROUP BY product,
sold_date;
§ We have one million different products, table contains data in the past 5 years.
Total groups = 1M * 5 * 365 = ~1.8B
Memory Usage – Estimation
§ EXPLAIN’s memory estimation issues
- Can be way off – much higher or much lower.
- Group-by/distinct estimate can be particularly off – when there’s a large number of group
by columns (independence assumption)
- Memory estimate = NDV of group by column 1 * NDV of group by column 2 * … NDV of
group by column n
- Ignore EXPLAIN’s estimation if it’s too high!
§ Do your own estimate for group by
- GROUP BY memory usage = (total number of groups * size of each row) + (total
number of groups * size of each row) / number node
Memory Usage – Hitting Mem-limit
- Gigantic group by
- The total number of distinct groups is huge, such as group by userid, phone number.
- For a simple query, you can try this advanced workaround – per-partition agg
- Requires the partition key to be part of the group by
SELECT part_key, col1, col2, …agg(..) FROM tbl WHERE part_key in
(1,2,3)
UNION ALL
SELECT part_key, col1, col2, …agg(..) FROM tbl WHERE part_key in
(4,5,6)
Memory Usage – Hitting Mem-limit
- Big-table joining big-table
- Big-table (after decompression, filtering, and projection) is a table that is bigger than
total cluster memory size.
- For a simple query, you can try this advanced workaround – per-partition join
- Requires the partition key to be part of the join key
SELECT … FROM BigTbl_A a JOIN BigTbl_B b WHERE a.part_key =
b.part_key AND a.part_key IN (1,2,3)
UNION ALL
SELECT … FROM BigTbl_A a JOIN BigTbl_B b WHERE a.part_key =
b.part_key AND a.part_key IN (4,5,6)
Query Execution – Typical Speed
- In a typical query, we observed following processing rate:
- Scan node 8~10M rows per core
- Join node ~10M rows per sec per core
- Agg node ~5M rows per sec per core
- Sort node ~17MB per sec per core
- Row materialization in coordinator should be tiny
- Parquet writer 1~5MB per sec per core
- If your processing rate is much lower than that, it’s worth a deeper look
Performance analysis – Example 3
~8M rows per second per core, this is
normal aggregation speed.
Performance analysis – Example 4
Data Distribution
Skew causes
execution skew
Performance analysis – Example 5
Possible root cause:
1. The host has a slow/bad
disk
2. The host has trouble to
communicate to NN
3. Hotspotting, the host does
more IO (not just this single
query, but overall) than
others
4. …
Performance analysis – Example 6
Only two parquet files to scan, not enough parallelism. Try using
smaller parquet block size for this table to increase parallelism.
Performance analysis – Example 7
SELECT colE, colU, colR, ... FROM temp WHERE year = 2017 AND month = 03
GROUP BY colE, colU, colR;
Slow network
- Impala uses Thrift to transmit compressed data between plan fragments
- Exchange operator is the receiver of the data
- DataStreamSender transmits the output rows of a plan fragment
DataStreamSender (dst_id=3)
- BytesSent: 402 B (402)
- InactiveTotalTime: 0ns (0)
- NetworkThroughput(*): 87.3 KiB/s (89436)
- OverallThroughput: 283.6 KiB/s (290417)
- PeakMemoryUsage: 120.6 KiB (123488)
- RowsReturned: 24 (24)
- SerializeBatchTime: 0ns (0)
- TotalTime: 888.97us (888969)
- TransmitDataRPCTime: 222.24us (222241)
- UncompressedRowBatchSize: 504 B (504)
EXCHANGE_NODE (id=3)
- ConvertRowBatchTime: 0ns (0)
- InactiveTotalTime: 0ns (0)
- RowsReturned: 24 (24)
- RowsReturnedRate: 7 per second (7)
- TotalTime: 3.02s (3016602849)
DataStreamReceiver
- BytesReceived: 402 B (402)
- DeserializeRowBatchTimer: 0ns (0)
- FirstBatchArrivalWaitTime: 1.83s (1830275553)
- InactiveTotalTime: 0ns (0)
- SendersBlockedTimer: 0ns (0)
- SendersBlockedTotalTimer(*): 0ns (0)
Exchange and DataStreamSender
55
Network slowness
§ Exchange performance issues
- Too much data across network:
- Check the query on data size reduction.
- Check join order and join strategy; Wrong join order/strategy can have a serious effect
on network!
- For agg, check the number of groups – affect memory too!
- Remove unused columns.
- Keep in mind that network is typically at most 10Gbit
§ Cross-rack network slowness
More examples/Exercises
- Parquet min/max filter, dictionary filter
- Spill to disk
- CPU saturated
- Scanner thread
- Detect small files
- Sink (DML queries)
Recap: Query Tuning
- Performance: Examine the logic of the query and validate the Explain Plan
Validate join order and join strategy.
Validate partition pruning and/or predicate pushdown.
Validate plan parallelism.
- Memory usage: Top causes (in order) of hitting mem-limit:
Lack of statistics
Lots of joins within a single query
Big-table joining big-table
Gigantic group by (e.g., distinct)
Parquet Writer
More resources
§ Impala cookbook https://blog.cloudera.com/blog/2017/02/latest-impala-cookbook/
§ Impala perf guideline
https://www.cloudera.com/documentation/enterprise/latest/topics/impala_perf_cookbook.ht
ml
§ Perf optimization https://conferences.oreilly.com/strata/strata-ca-
2017/public/schedule/detail/55783
60© Cloudera, Inc. All rights reserved.
Thank you
Q & A

More Related Content

What's hot

Dynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisationDynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisationOri Reshef
 
Apache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data FrameworkApache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data FrameworkWes McKinney
 
Cloudera Impala Internals
Cloudera Impala InternalsCloudera Impala Internals
Cloudera Impala InternalsDavid Groozman
 
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...HostedbyConfluent
 
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander ZaitsevClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander ZaitsevAltinity Ltd
 
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptx
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptxGrafana Mimir and VictoriaMetrics_ Performance Tests.pptx
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptxRomanKhavronenko
 
Apache Hadoop and HBase
Apache Hadoop and HBaseApache Hadoop and HBase
Apache Hadoop and HBaseCloudera, Inc.
 
Optimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsOptimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsDatabricks
 
Big data-cheat-sheet
Big data-cheat-sheetBig data-cheat-sheet
Big data-cheat-sheetmasoodkhh
 
Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive

Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive

Cloudera, Inc.
 
Building Real-time Pipelines with FLaNK_ A Case Study with Transit Data
Building Real-time Pipelines with FLaNK_ A Case Study with Transit DataBuilding Real-time Pipelines with FLaNK_ A Case Study with Transit Data
Building Real-time Pipelines with FLaNK_ A Case Study with Transit DataTimothy Spann
 
How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...DataWorks Summit/Hadoop Summit
 
Using Apache Hive with High Performance
Using Apache Hive with High PerformanceUsing Apache Hive with High Performance
Using Apache Hive with High PerformanceInderaj (Raj) Bains
 
대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐
대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐
대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐Terry Cho
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAltinity Ltd
 
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...Databricks
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumTathastu.ai
 

What's hot (20)

Dynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisationDynamic filtering for presto join optimisation
Dynamic filtering for presto join optimisation
 
Apache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data FrameworkApache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data Framework
 
Cloudera Impala Internals
Cloudera Impala InternalsCloudera Impala Internals
Cloudera Impala Internals
 
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...
Streaming Data Lakes using Kafka Connect + Apache Hudi | Vinoth Chandar, Apac...
 
Optimizing Hive Queries
Optimizing Hive QueriesOptimizing Hive Queries
Optimizing Hive Queries
 
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander ZaitsevClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
 
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptx
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptxGrafana Mimir and VictoriaMetrics_ Performance Tests.pptx
Grafana Mimir and VictoriaMetrics_ Performance Tests.pptx
 
Apache Hadoop and HBase
Apache Hadoop and HBaseApache Hadoop and HBase
Apache Hadoop and HBase
 
Snowflake Datawarehouse Architecturing
Snowflake Datawarehouse ArchitecturingSnowflake Datawarehouse Architecturing
Snowflake Datawarehouse Architecturing
 
Optimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsOptimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL Joins
 
Big data-cheat-sheet
Big data-cheat-sheetBig data-cheat-sheet
Big data-cheat-sheet
 
Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive

Apache Kudu: Technical Deep Dive


Apache Kudu: Technical Deep Dive


 
Building Real-time Pipelines with FLaNK_ A Case Study with Transit Data
Building Real-time Pipelines with FLaNK_ A Case Study with Transit DataBuilding Real-time Pipelines with FLaNK_ A Case Study with Transit Data
Building Real-time Pipelines with FLaNK_ A Case Study with Transit Data
 
How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...How to understand and analyze Apache Hive query execution plan for performanc...
How to understand and analyze Apache Hive query execution plan for performanc...
 
Using Apache Hive with High Performance
Using Apache Hive with High PerformanceUsing Apache Hive with High Performance
Using Apache Hive with High Performance
 
대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐
대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐
대용량 분산 아키텍쳐 설계 #3 대용량 분산 시스템 아키텍쳐
 
All about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdfAll about Zookeeper and ClickHouse Keeper.pdf
All about Zookeeper and ClickHouse Keeper.pdf
 
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...
Migrating Apache Hive Workload to Apache Spark: Bridge the Gap with Zhan Zhan...
 
Apache NiFi in the Hadoop Ecosystem
Apache NiFi in the Hadoop Ecosystem Apache NiFi in the Hadoop Ecosystem
Apache NiFi in the Hadoop Ecosystem
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium
 

Similar to How to use Impala query plan and profile to fix performance issues

SnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14th
SnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14thSnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14th
SnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14thSnappyData
 
Scaling machine learning to millions of users with Apache Beam
Scaling machine learning to millions of users with Apache BeamScaling machine learning to millions of users with Apache Beam
Scaling machine learning to millions of users with Apache BeamTatiana Al-Chueyr
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performanceEngine Yard
 
Analyze database system using a 3 d method
Analyze database system using a 3 d methodAnalyze database system using a 3 d method
Analyze database system using a 3 d methodAjith Narayanan
 
Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2zhang hua
 
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...InfluxData
 
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaBest Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaDatabricks
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profilerIhor Bobak
 
What’s New in the Upcoming Apache Spark 3.0
What’s New in the Upcoming Apache Spark 3.0What’s New in the Upcoming Apache Spark 3.0
What’s New in the Upcoming Apache Spark 3.0Databricks
 
The Data Center and Hadoop
The Data Center and HadoopThe Data Center and Hadoop
The Data Center and HadoopMichael Zhang
 
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...Lucidworks
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cRonald Francisco Vargas Quesada
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 
Apache Spark 3.0: Overview of What’s New and Why Care
Apache Spark 3.0: Overview of What’s New and Why CareApache Spark 3.0: Overview of What’s New and Why Care
Apache Spark 3.0: Overview of What’s New and Why CareDatabricks
 
Strata + Hadoop 2015 Slides
Strata + Hadoop 2015 SlidesStrata + Hadoop 2015 Slides
Strata + Hadoop 2015 SlidesJun Liu
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaaCuneyt Goksu
 
Advanced Analytics using Apache Hive
Advanced Analytics using Apache HiveAdvanced Analytics using Apache Hive
Advanced Analytics using Apache HiveMurtaza Doctor
 
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Jim Czuprynski
 
Webinar: Performance Tuning + Optimization
Webinar: Performance Tuning + OptimizationWebinar: Performance Tuning + Optimization
Webinar: Performance Tuning + OptimizationMongoDB
 

Similar to How to use Impala query plan and profile to fix performance issues (20)

SnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14th
SnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14thSnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14th
SnappyData Ad Analytics Use Case -- BDAM Meetup Sept 14th
 
Scaling machine learning to millions of users with Apache Beam
Scaling machine learning to millions of users with Apache BeamScaling machine learning to millions of users with Apache Beam
Scaling machine learning to millions of users with Apache Beam
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
 
Analyze database system using a 3 d method
Analyze database system using a 3 d methodAnalyze database system using a 3 d method
Analyze database system using a 3 d method
 
Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2Swift distributed tracing method and tools v2
Swift distributed tracing method and tools v2
 
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
Optimizing InfluxDB Performance in the Real World by Dean Sheehan, Senior Dir...
 
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaBest Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and Delta
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
What’s New in the Upcoming Apache Spark 3.0
What’s New in the Upcoming Apache Spark 3.0What’s New in the Upcoming Apache Spark 3.0
What’s New in the Upcoming Apache Spark 3.0
 
The Data Center and Hadoop
The Data Center and HadoopThe Data Center and Hadoop
The Data Center and Hadoop
 
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...
High Performance Solr and JVM Tuning Strategies used for MapQuest’s Search Ah...
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 
What's New in Apache Hive
What's New in Apache HiveWhat's New in Apache Hive
What's New in Apache Hive
 
Apache Spark 3.0: Overview of What’s New and Why Care
Apache Spark 3.0: Overview of What’s New and Why CareApache Spark 3.0: Overview of What’s New and Why Care
Apache Spark 3.0: Overview of What’s New and Why Care
 
Strata + Hadoop 2015 Slides
Strata + Hadoop 2015 SlidesStrata + Hadoop 2015 Slides
Strata + Hadoop 2015 Slides
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaa
 
Advanced Analytics using Apache Hive
Advanced Analytics using Apache HiveAdvanced Analytics using Apache Hive
Advanced Analytics using Apache Hive
 
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?
 
Webinar: Performance Tuning + Optimization
Webinar: Performance Tuning + OptimizationWebinar: Performance Tuning + Optimization
Webinar: Performance Tuning + Optimization
 

More from Cloudera, Inc.

Partner Briefing_January 25 (FINAL).pptx
Partner Briefing_January 25 (FINAL).pptxPartner Briefing_January 25 (FINAL).pptx
Partner Briefing_January 25 (FINAL).pptxCloudera, Inc.
 
Cloudera Data Impact Awards 2021 - Finalists
Cloudera Data Impact Awards 2021 - Finalists Cloudera Data Impact Awards 2021 - Finalists
Cloudera Data Impact Awards 2021 - Finalists Cloudera, Inc.
 
2020 Cloudera Data Impact Awards Finalists
2020 Cloudera Data Impact Awards Finalists2020 Cloudera Data Impact Awards Finalists
2020 Cloudera Data Impact Awards FinalistsCloudera, Inc.
 
Edc event vienna presentation 1 oct 2019
Edc event vienna presentation 1 oct 2019Edc event vienna presentation 1 oct 2019
Edc event vienna presentation 1 oct 2019Cloudera, Inc.
 
Machine Learning with Limited Labeled Data 4/3/19
Machine Learning with Limited Labeled Data 4/3/19Machine Learning with Limited Labeled Data 4/3/19
Machine Learning with Limited Labeled Data 4/3/19Cloudera, Inc.
 
Data Driven With the Cloudera Modern Data Warehouse 3.19.19
Data Driven With the Cloudera Modern Data Warehouse 3.19.19Data Driven With the Cloudera Modern Data Warehouse 3.19.19
Data Driven With the Cloudera Modern Data Warehouse 3.19.19Cloudera, Inc.
 
Introducing Cloudera DataFlow (CDF) 2.13.19
Introducing Cloudera DataFlow (CDF) 2.13.19Introducing Cloudera DataFlow (CDF) 2.13.19
Introducing Cloudera DataFlow (CDF) 2.13.19Cloudera, Inc.
 
Introducing Cloudera Data Science Workbench for HDP 2.12.19
Introducing Cloudera Data Science Workbench for HDP 2.12.19Introducing Cloudera Data Science Workbench for HDP 2.12.19
Introducing Cloudera Data Science Workbench for HDP 2.12.19Cloudera, Inc.
 
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19Cloudera, Inc.
 
Leveraging the cloud for analytics and machine learning 1.29.19
Leveraging the cloud for analytics and machine learning 1.29.19Leveraging the cloud for analytics and machine learning 1.29.19
Leveraging the cloud for analytics and machine learning 1.29.19Cloudera, Inc.
 
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19Cloudera, Inc.
 
Leveraging the Cloud for Big Data Analytics 12.11.18
Leveraging the Cloud for Big Data Analytics 12.11.18Leveraging the Cloud for Big Data Analytics 12.11.18
Leveraging the Cloud for Big Data Analytics 12.11.18Cloudera, Inc.
 
Modern Data Warehouse Fundamentals Part 3
Modern Data Warehouse Fundamentals Part 3Modern Data Warehouse Fundamentals Part 3
Modern Data Warehouse Fundamentals Part 3Cloudera, Inc.
 
Modern Data Warehouse Fundamentals Part 2
Modern Data Warehouse Fundamentals Part 2Modern Data Warehouse Fundamentals Part 2
Modern Data Warehouse Fundamentals Part 2Cloudera, Inc.
 
Modern Data Warehouse Fundamentals Part 1
Modern Data Warehouse Fundamentals Part 1Modern Data Warehouse Fundamentals Part 1
Modern Data Warehouse Fundamentals Part 1Cloudera, Inc.
 
Extending Cloudera SDX beyond the Platform
Extending Cloudera SDX beyond the PlatformExtending Cloudera SDX beyond the Platform
Extending Cloudera SDX beyond the PlatformCloudera, Inc.
 
Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18Cloudera, Inc.
 
Analyst Webinar: Doing a 180 on Customer 360
Analyst Webinar: Doing a 180 on Customer 360Analyst Webinar: Doing a 180 on Customer 360
Analyst Webinar: Doing a 180 on Customer 360Cloudera, Inc.
 
Build a modern platform for anti-money laundering 9.19.18
Build a modern platform for anti-money laundering 9.19.18Build a modern platform for anti-money laundering 9.19.18
Build a modern platform for anti-money laundering 9.19.18Cloudera, Inc.
 
Introducing the data science sandbox as a service 8.30.18
Introducing the data science sandbox as a service 8.30.18Introducing the data science sandbox as a service 8.30.18
Introducing the data science sandbox as a service 8.30.18Cloudera, Inc.
 

More from Cloudera, Inc. (20)

Partner Briefing_January 25 (FINAL).pptx
Partner Briefing_January 25 (FINAL).pptxPartner Briefing_January 25 (FINAL).pptx
Partner Briefing_January 25 (FINAL).pptx
 
Cloudera Data Impact Awards 2021 - Finalists
Cloudera Data Impact Awards 2021 - Finalists Cloudera Data Impact Awards 2021 - Finalists
Cloudera Data Impact Awards 2021 - Finalists
 
2020 Cloudera Data Impact Awards Finalists
2020 Cloudera Data Impact Awards Finalists2020 Cloudera Data Impact Awards Finalists
2020 Cloudera Data Impact Awards Finalists
 
Edc event vienna presentation 1 oct 2019
Edc event vienna presentation 1 oct 2019Edc event vienna presentation 1 oct 2019
Edc event vienna presentation 1 oct 2019
 
Machine Learning with Limited Labeled Data 4/3/19
Machine Learning with Limited Labeled Data 4/3/19Machine Learning with Limited Labeled Data 4/3/19
Machine Learning with Limited Labeled Data 4/3/19
 
Data Driven With the Cloudera Modern Data Warehouse 3.19.19
Data Driven With the Cloudera Modern Data Warehouse 3.19.19Data Driven With the Cloudera Modern Data Warehouse 3.19.19
Data Driven With the Cloudera Modern Data Warehouse 3.19.19
 
Introducing Cloudera DataFlow (CDF) 2.13.19
Introducing Cloudera DataFlow (CDF) 2.13.19Introducing Cloudera DataFlow (CDF) 2.13.19
Introducing Cloudera DataFlow (CDF) 2.13.19
 
Introducing Cloudera Data Science Workbench for HDP 2.12.19
Introducing Cloudera Data Science Workbench for HDP 2.12.19Introducing Cloudera Data Science Workbench for HDP 2.12.19
Introducing Cloudera Data Science Workbench for HDP 2.12.19
 
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19
Shortening the Sales Cycle with a Modern Data Warehouse 1.30.19
 
Leveraging the cloud for analytics and machine learning 1.29.19
Leveraging the cloud for analytics and machine learning 1.29.19Leveraging the cloud for analytics and machine learning 1.29.19
Leveraging the cloud for analytics and machine learning 1.29.19
 
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19
Modernizing the Legacy Data Warehouse – What, Why, and How 1.23.19
 
Leveraging the Cloud for Big Data Analytics 12.11.18
Leveraging the Cloud for Big Data Analytics 12.11.18Leveraging the Cloud for Big Data Analytics 12.11.18
Leveraging the Cloud for Big Data Analytics 12.11.18
 
Modern Data Warehouse Fundamentals Part 3
Modern Data Warehouse Fundamentals Part 3Modern Data Warehouse Fundamentals Part 3
Modern Data Warehouse Fundamentals Part 3
 
Modern Data Warehouse Fundamentals Part 2
Modern Data Warehouse Fundamentals Part 2Modern Data Warehouse Fundamentals Part 2
Modern Data Warehouse Fundamentals Part 2
 
Modern Data Warehouse Fundamentals Part 1
Modern Data Warehouse Fundamentals Part 1Modern Data Warehouse Fundamentals Part 1
Modern Data Warehouse Fundamentals Part 1
 
Extending Cloudera SDX beyond the Platform
Extending Cloudera SDX beyond the PlatformExtending Cloudera SDX beyond the Platform
Extending Cloudera SDX beyond the Platform
 
Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18Federated Learning: ML with Privacy on the Edge 11.15.18
Federated Learning: ML with Privacy on the Edge 11.15.18
 
Analyst Webinar: Doing a 180 on Customer 360
Analyst Webinar: Doing a 180 on Customer 360Analyst Webinar: Doing a 180 on Customer 360
Analyst Webinar: Doing a 180 on Customer 360
 
Build a modern platform for anti-money laundering 9.19.18
Build a modern platform for anti-money laundering 9.19.18Build a modern platform for anti-money laundering 9.19.18
Build a modern platform for anti-money laundering 9.19.18
 
Introducing the data science sandbox as a service 8.30.18
Introducing the data science sandbox as a service 8.30.18Introducing the data science sandbox as a service 8.30.18
Introducing the data science sandbox as a service 8.30.18
 

Recently uploaded

RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhijennyeacort
 
MK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docxMK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docxUnduhUnggah1
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptSonatrach
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Colleen Farrelly
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Cantervoginip
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfchwongval
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...limedy534
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...Boston Institute of Analytics
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanMYRABACSAFRA2
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.natarajan8993
 

Recently uploaded (20)

E-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptxE-Commerce Order PredictionShraddha Kamble.pptx
E-Commerce Order PredictionShraddha Kamble.pptx
 
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝DelhiRS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
RS 9000 Call In girls Dwarka Mor (DELHI)⇛9711147426🔝Delhi
 
MK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docxMK KOMUNIKASI DATA (TI)komdat komdat.docx
MK KOMUNIKASI DATA (TI)komdat komdat.docx
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.pptdokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
dokumen.tips_chapter-4-transient-heat-conduction-mehmet-kanoglu.ppt
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024Generative AI for Social Good at Open Data Science East 2024
Generative AI for Social Good at Open Data Science East 2024
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
ASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel CanterASML's Taxonomy Adventure by Daniel Canter
ASML's Taxonomy Adventure by Daniel Canter
 
Multiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdfMultiple time frame trading analysis -brianshannon.pdf
Multiple time frame trading analysis -brianshannon.pdf
 
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
Effects of Smartphone Addiction on the Academic Performances of Grades 9 to 1...
 
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制南十字星大学毕业证(SCU毕业证)#文凭成绩单#真实留信学历认证永久存档
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
毕业文凭制作#回国入职#diploma#degree澳洲中央昆士兰大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
NLP Data Science Project Presentation:Predicting Heart Disease with NLP Data ...
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
Identifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population MeanIdentifying Appropriate Test Statistics Involving Population Mean
Identifying Appropriate Test Statistics Involving Population Mean
 
RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.RABBIT: A CLI tool for identifying bots based on their GitHub events.
RABBIT: A CLI tool for identifying bots based on their GitHub events.
 

How to use Impala query plan and profile to fix performance issues

  • 1. How to use Impala query plan and profile to fix performance issues Juan Yu Impala Field Engineer, Cloudera
  • 2. Profiles?! Explain plans!? Arggghh… § For the end user, understanding Impala performance is like… - Lots of commonality between requests, e.g. - What’s the bottleneck for this query? - Why this run is fast but that run is slow? - How can I tune to improve this query’s performance.
  • 3. Agenda - What are query plan and profile - What kind of issues query plan and profile can help you solve - Structure of query plan and profile - Basic troubleshooting - Advanced query tuning and troubleshooting
  • 4. Why did the following queries take different time? SELECT AVG(ss_list_price) FROM store_sales WHERE ss_sold_date_sk BETWEEN 2451959 AND 2451989; Fetched 1 row(s) in 0.28s SELECT AVG(ss_list_price) FROM store_sales; Fetched 1 row(s) in 3.60s Partition Pruning reduces scan work and intermediate result.
  • 5. Where to get Query plan and profile - Cloudera Manager Query history page - Impala webUI queries page - Impala-shell - Profile examples: https://github.com/yjwater/strata-sj
  • 6. Query Planning: Goals - Lower execution cost and get better performance - Reduce unnecessary work as much as possible by partition pruning, predicate pushdown, runtime filter,etc. - Maximize scan locality using DN block metadata. - Minimize data movement (optimize join order, choose better join strategy) - Parallel tasks and run them on many nodes to shorten execution time.
  • 7. Query profile - Execution Results - Provide metrics and counters to show - how execution is ongoing. - how much resources are used. - how long each piece takes. - Is there any bottleneck and/or abnormal behavior.
  • 8. What issues query plan and profile can help you solve? § Plan: - Missing stats - Partition pruning - Predicate pushdown - Join order - Join strategy - Parallelism § Profile: - Identify Bottleneck - Runtime filter effectiveness - Memory usage/Spill to disk - Network slowness - Skew - Client side issues - Metadata loading
  • 9. Flow of a SQL Query Compile Query Execute Query Client Client SQL Text Executable Plan Query Results Impala Frontend (Java) Impala Backend (C++) Query Profile
  • 10. Impala - Logical view Query Compiler Query Executor Query Coordinator Metadata HDFS Kudu S3/ADLS HBase Query Compiler Query Executor Query Coordinator Metadata Query Compiler Query Executor Query Coordinator Metadata Hive Metastore HDFS NameNode StateStore Catalog FE (Java) BE (C++) HDFS Kudu S3/ADLS HBase HDFS Kudu S3/ADLS HBase Metadata Impalad Impalad Impalad Metadata/control Execution Storage Sentry Role: admin, Privs: R/W access on ALL Role: user, Privs: R access on TABLE db1.foo, ... Dir: hdfs://db1/foo, File: foo1.csv, Blocks:...., Size: 100B Dir: S3://bucket/db2/blah, File: blah1.parq, Size: 1GB DB: db1, Tbl: foo (a int,...) location ‘hdfs://…’ DB: db2, Tbl: blah (b string..) location ‘s3://…’
  • 11. Impala in action - Select query Query Compiler Query Executor Query Coordinator Metadata HDFS Kudu S3/ADLS HBase Query Compiler Query Executor Query Coordinator Metadata Query Compiler Query Executor Query Coordinator Metadata Hive Metastore HDFS NameNode StateStore Catalog HDFS Kudu S3/ADLS HBase HDFS Kudu S3/ADLS HBase Metadata Impalad Impalad Impalad SQL App ODBC/JDBC select * from db.foo; 0 1 2 34 5 6 7
  • 12. Query Planning - Single-Node Plan (SET NUM_NODES=1): - Assigns predicates to lowest plan node. - Prunes irrelevant columns and partitions (if applicable). - Optimizes join order. - Determine effective runtime filters - Distributed Plan: - Provides list of best Impalads to do the scan work. - Picks an execution strategy for each join (broadcast vs hash-partitioned) - Introduces exchange operators and groups nodes in plan fragments (unit of work).
  • 13. Compile query HashJoin Scan: t1 Scan: t3 Scan: t2 HashJoin TopN Agg SELECT t1.dept, SUM(t2.revenue) FROM LargeHdfsTable t1 JOIN SmallHdfsTable t2 ON (t1.id1 = t2.id) JOIN LargeHbaseTable t3 ON (t1.id2 = t3.id) WHERE t3.category = 'Online‘ AND t1.id > 10 GROUP BY t1.dept HAVING COUNT(t2.revenue) > 10 ORDER BY revenue LIMIT 10 Hint: set num_nodes=1; to explain the single node plan
  • 14. HashJoin Scan: t1 Scan: t3 Scan: t2 HashJoin TopN Agg Single-Node Plan HashJoin Scan: t1 Scan: t3 Scan: t2 HashJoin TopN Pre-Agg Exchange Exchange Exchange Exchange Merge-Agg ExchangeTopN Distributed Plan This is what EXPLAIN shows by default Single to Distributed Node Plan
  • 15. HashJoin Scan: t1 Scan: t3 Scan: t2 HashJoin TopN Pre-Agg Exchange Exchange Exchange Exchange Merge-Agg ExchangeTopN PlanFragment execution model subject to change Plan Fragmentation HashJoin Scan: t1 Scan: t3 Scan: t2 HashJoin TopN Agg Single-Node Plan Distributed Plan
  • 16. Query Plan Visualization select c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice, sum(l_quantity) from customer, orders, lineitem where o_orderkey in ( select l_orderkey from lineitem group by l_orderkey having sum(l_quantity) > 300 ) and c_custkey = o_custkey and o_orderkey = l_orderkey group by c_name, c_custkey, o_orderkey, o_orderdate, o_totalprice order by o_totalprice desc, o_orderdate limit 100
  • 17. F3, instance 0 Query Execution node 1 node 2 coordinator F1, instance 0 SCAN t2 F2, instance 0 HASH JOIN F0, instance 0 SCAN t1 F2, instance 1 HASH JOIN F0, instance 1 SCAN t1 F1, instance1 SCAN t2 Legend Plan Fragment Fragment Instance F2, instance 0 HASH JOIN Operator Exchanges 03, 04 Exchange 05 Ø explain SELECT * FROM t1 JOIN [shuffle] t2 ON t1.id = t2.id; +-----------------------------------------------------------+ | Explain String | +-----------------------------------------------------------+ | Estimated Per-Host Requirements: Memory=240.00MB VCores=2 | | | | 05:EXCHANGE [UNPARTITIONED] | | | | | 02:HASH JOIN [INNER JOIN, PARTITIONED] | | | hash predicates: t1.id = t2.id | | | | | |--04:EXCHANGE [HASH(t2.id)] | | | | | | | 01:SCAN HDFS [functional.alltypestiny t2] | | | partitions=4/4 files=4 size=460B | | | | | 03:EXCHANGE [HASH(t1.id)] | | | | | 00:SCAN HDFS [functional.alltypes t1] | | partitions=24/24 files=24 size=478.45KB | +-----------------------------------------------------------+
  • 18. Plan and Profile structure Query Summary |- Basic info: state, type, user, statement, coordinator |- Query plan |- Execution summary |- Timeline Client side info Execution details |- Runtime Filter table |- Coordinator Fragment |- Instance |- Operator node A … |- Average Fragment 3 |- Fragment instance 0 |- Operator node B ... |- Fragment instance 1 ... |- Average Fragment 2 |- Average Fragment 0 explain_level = 3
  • 19. Basic Query information Query (id=5349daec57a4d786:9536a60900000000): Summary: Session ID: 5245f03b5b3c17ec:1dbd50ff83471f95 Session Type: HIVESERVER2 HiveServer2 Protocol Version: V6 Start Time: 2018-02-09 13:17:31.162274000 End Time: 2018-02-09 13:20:05.281900000 Query Type: QUERY Query State: FINISHED Query Status: OK Impala Version: impalad version 2.11.0-cdh5.14.0 User: REDACTED Connected User: REDACTED Delegated User: Network Address: REDACTED:54129 Default Db: tpch_100_parquet Sql Statement: select * from lineitems limit 100 Coordinator: REDACTED:22000 Query Options (set by configuration): ABORT_ON_ERROR=1,MEM_LIMIT=5658116096 Query Options (set by configuration and planner): ABORT_ON_ERROR=1,MEM_LIMIT=5658116096,MT_DOP=0
  • 20. Look into the Timeline Planner Timeline: 218.105ms - Analysis finished: 159.486ms (159.486ms) - Value transfer graph computed: 159.522ms (35.958us) - Single node plan created: 162.606ms (3.083ms) - Runtime filters computed: 162.869ms (262.984us) - Distributed plan created: 162.908ms (39.628us) - Lineage info computed: 163.006ms (97.845us) - Planning finished: 218.105ms (55.098ms) Query Timeline: 2m34s - Query submitted: 12.693ms (12.693ms) - Planning finished: 350.339ms (337.646ms) - Submit for admission: 422.437ms (72.097ms) - Completed admission: 433.900ms (11.462ms) - Ready to start on 8 backends: 648.182ms (214.282ms) - All 8 execution backends (47 fragment instances) started: 5s683ms (5s035ms) - First dynamic filter received: 1m50s (1m44s) - Rows available: 2m32s (41s835ms) - First row fetched: 2m32s (447.280ms) - Unregister query: 2m34s (1s232ms)
  • 21. Client side - Avoid large data extract. - It’s usually not a good idea to dump lots of data out using JDBC/ODBC. - For Impala-shell, use the –B option to fetch lots of data. Total query time Idle time: client isn’t fetching
  • 23. ExecSummary – Find Bottlenecks - Use ExecSummary from Query Profile to identify bottlenecks
  • 24. ExecSummary – Find Skew - Use ExecSummary from Query Profile to identify skew - Max Time is significantly more than Avg Time => Skew!
  • 25. Exercises - Predicate pushdown - Remote read - Codegen - Planning time - DDLs
  • 26. Advanced Query Tuning and Troubleshooting
  • 27. Advanced Query Tuning - Common issues - Query succeeds but very slow - Query fails with OOM error - - How to address them - Examine the logic of the query and validate the Explain Plan - Use Query Profile to identify bottlenecks.
  • 28. Performance analysis – Example 1 § Fix: Compute stats <table> Corrupted stats
  • 29. | Estimated Per-Host Requirements: Memory=84.76GB VCores=3 | | WARNING: The following tables are missing relevant table and/or column statistics. | | tpcds500gb_parquet.date_dim, tpcds500gb_parquet.store_sales, tpcds500gb_parquet.item | | | 04:HASH JOIN [INNER JOIN, BROADCAST] | | | hash predicates: store_sales.ss_item_sk = item.i_item_sk | | | | | |--08:EXCHANGE [BROADCAST] | | | | | | | 02:SCAN HDFS [tpcds500gb_parquet.item] | | | partitions=1/1 size=3.14MB | | | predicates: item.i_manager_id = 1 | | | | | 03:HASH JOIN [INNER JOIN, BROADCAST] | | | hash predicates: dt.d_date_sk = store_sales.ss_sold_date_sk | | | | | |--07:EXCHANGE [BROADCAST] | | | | | | | 01:SCAN HDFS [tpcds500gb_parquet.store_sales] | | | partitions=1823/1823 size=180.21GB | | | | | 00:SCAN HDFS [tpcds500gb_parquet.date_dim dt] | | partitions=1/1 size=2.41MB | | predicates: dt.d_moy = 12, dt.d_year = 1998 | +-------------------------------------------------------------------------------------------------------+ Missing stats Performance analysis – Example 2
  • 30. Performance analysis – Example 2 (good plan) … | | |--07:EXCHANGE [BROADCAST] | | | | hosts=3 per-host-mem=0B | | | | tuple-ids=0 row-size=16B cardinality=29 | | | | | | | 00:SCAN HDFS [tpcds500gb_parquet.date_dim dt, RANDOM] | | | partitions=1/1 size=2.41MB | | | predicates: dt.d_moy = 12, dt.d_year = 1998 | | | table stats: 73049 rows total | | | column stats: all | | | hosts=3 per-host-mem=48.00MB | | | tuple-ids=0 row-size=16B cardinality=29 | | | | | 01:SCAN HDFS [tpcds500gb_parquet.store_sales, RANDOM] | | partitions=1823/1823 size=180.21GB | | table stats: 4125561494 rows total | | column stats: all | | hosts=10 per-host-mem=176.00MB | | tuple-ids=1 row-size=20B cardinality=4125561494 | +-------------------------------------------------------------------------------------------------------+ set explain_level=3; set num_nodes=0;
  • 31. Query Tuning Basics - Join § Validate join order and join strategy - Optimal Join Order - RHS should be smaller than LHS - Minimize intermediate results - Strategy – Broadcast vs. Partitioned - Network costs (partition and send lhs+rhs or broadcast rhs) - Memory costs - RHS must fit in memory!
  • 32. Join-Order Optimization SELECT … FROM T1, T2, T3, T4 WHERE T1.id = T2.id AND T2.id = T3.id AND T3.id = T4.id; T1 T2 T3 T4 HJ HJ HJ
  • 33. Use of Statistics during Plan Generation - Table statistics: Number of rows per partition/table. - Column statistics: Number of distinct values per column. - Use of table and column statistics - Estimate selectivity of predicates (esp. scan predicates like “month=10”). - Estimate selectivity of joins à join cardinality (#rows) - Heuristic FK/PK detection. - Pick distributed join strategy: broadcast vs. partitioned - Join inputs have very different size à broadcast small side. - Join inputs have roughly equal size à partitioned.
  • 34. Join Execution Strategy § Broadcast Join § Repartition Join A join B A join B A join B Scan and Broadcast Table B A join B A join B A join B Scan and repartition both tables according to join keys Local scan for Table A
  • 35. Join Strategy – what’s the cost - Impala choses the right strategy based on stats (collect stats!) - Use the join strategy that minimizes data transfer - Use explain plan to see the data size - Join Hint: [shuffle] or [broadcast] Join strategy cost Network Traffic Memory Usage (HashTable) Broadcast Join RHS table size1 x number of node RHS table size1 x number of node Partitioned Join LHS + RHS table size1 RHS table size1 1 table size refers to the data flowed from the child node (i.e. only required column data after filtering counts).
  • 36. Join - Exercise § TPCH 100GB data on 8-node cluster - Table1: lineitem. cardinality=600M, row size ~ 260B - Table2: orders. cardinality=150M, row size ~ 200B - orderkey is bigint. § For the following query, what’s the optimal join order and join strategy. - SELECT count(*) FROM lineitem JOIN orders ON l_orderkey = o_orderkey; - SELECT lineitem.* FROM lineitem JOIN orders ON l_orderkey = o_orderkey; - SELECT orders.* FROM lineitem JOIN orders ON l_orderkey = o_orderkey; § How about on a 100-node cluster?
  • 37. Runtime Filter - Check how selective the join is Large hash join output (~2.8B), the output of upstream one is much smaller (32M, reduced to only ~1%). This indicates runtime filter can be helpful.
  • 39. Why Runtime Filter doesn’t work sometimes? Filter doesn‘t take effect because scan was short and finished before filter arrived. HDFS_SCAN_NODE (id=3): Filter 1 (1.00 MB): - Rows processed: 16.38K (16383) - Rows rejected: 0 (0) - Rows total: 16.38K (16384)
  • 40. How to tune it? - Increase RUNTIME_FILTER_WAIT_TIME_MS to 5000ms to let Scan Node 03 wait longer time for the filter. HDFS_SCAN_NODE (id=3) Filter 1 (1.00 MB) - InactiveTotalTime: 0 - Rows processed: 73049 - Rows rejected: 73018 - Rows total: 73049 - TotalTime: 0 - If the cluster is relatively busy, consider increasing the wait time too so that complicated queries do not miss opportunities for optimization.
  • 41. Runtime filter profile examples - Profile walkthrough - Effective vs Non-Effective - Local vs Global - Filter Wait Time - Filter Memory Usage
  • 42. Memory § Planner estimation 42 § Actual usage from profile § Metrics per node
  • 44. Memory – Insert strategy § Non-shuffle § Shuffle Node A Partition data 1, 3, 5, 6 Node B Partition data 2, 3, 6, 7 Node C Partition data 3, 4, 8 Node D Partition data 1, 4, 7, 8 4 writers 4 writers 3 writers 4 writers Node A Partition data 1, 5 Node B Partition data 2, 6 Node C Partition data 3, 7 Node D Partition data 4, 8 2 writers 2 writers 2 writers 2 writers
  • 45. Memory – Group By § SELECT product, count(1), sold_date FROM sales_history GROUP BY product, sold_date; § We have one million different products, table contains data in the past 5 years. Total groups = 1M * 5 * 365 = ~1.8B
  • 46. Memory Usage – Estimation § EXPLAIN’s memory estimation issues - Can be way off – much higher or much lower. - Group-by/distinct estimate can be particularly off – when there’s a large number of group by columns (independence assumption) - Memory estimate = NDV of group by column 1 * NDV of group by column 2 * … NDV of group by column n - Ignore EXPLAIN’s estimation if it’s too high! § Do your own estimate for group by - GROUP BY memory usage = (total number of groups * size of each row) + (total number of groups * size of each row) / number node
  • 47. Memory Usage – Hitting Mem-limit - Gigantic group by - The total number of distinct groups is huge, such as group by userid, phone number. - For a simple query, you can try this advanced workaround – per-partition agg - Requires the partition key to be part of the group by SELECT part_key, col1, col2, …agg(..) FROM tbl WHERE part_key in (1,2,3) UNION ALL SELECT part_key, col1, col2, …agg(..) FROM tbl WHERE part_key in (4,5,6)
  • 48. Memory Usage – Hitting Mem-limit - Big-table joining big-table - Big-table (after decompression, filtering, and projection) is a table that is bigger than total cluster memory size. - For a simple query, you can try this advanced workaround – per-partition join - Requires the partition key to be part of the join key SELECT … FROM BigTbl_A a JOIN BigTbl_B b WHERE a.part_key = b.part_key AND a.part_key IN (1,2,3) UNION ALL SELECT … FROM BigTbl_A a JOIN BigTbl_B b WHERE a.part_key = b.part_key AND a.part_key IN (4,5,6)
  • 49. Query Execution – Typical Speed - In a typical query, we observed following processing rate: - Scan node 8~10M rows per core - Join node ~10M rows per sec per core - Agg node ~5M rows per sec per core - Sort node ~17MB per sec per core - Row materialization in coordinator should be tiny - Parquet writer 1~5MB per sec per core - If your processing rate is much lower than that, it’s worth a deeper look
  • 50. Performance analysis – Example 3 ~8M rows per second per core, this is normal aggregation speed.
  • 51. Performance analysis – Example 4 Data Distribution Skew causes execution skew
  • 52. Performance analysis – Example 5 Possible root cause: 1. The host has a slow/bad disk 2. The host has trouble to communicate to NN 3. Hotspotting, the host does more IO (not just this single query, but overall) than others 4. …
  • 53. Performance analysis – Example 6 Only two parquet files to scan, not enough parallelism. Try using smaller parquet block size for this table to increase parallelism.
  • 54. Performance analysis – Example 7 SELECT colE, colU, colR, ... FROM temp WHERE year = 2017 AND month = 03 GROUP BY colE, colU, colR; Slow network
  • 55. - Impala uses Thrift to transmit compressed data between plan fragments - Exchange operator is the receiver of the data - DataStreamSender transmits the output rows of a plan fragment DataStreamSender (dst_id=3) - BytesSent: 402 B (402) - InactiveTotalTime: 0ns (0) - NetworkThroughput(*): 87.3 KiB/s (89436) - OverallThroughput: 283.6 KiB/s (290417) - PeakMemoryUsage: 120.6 KiB (123488) - RowsReturned: 24 (24) - SerializeBatchTime: 0ns (0) - TotalTime: 888.97us (888969) - TransmitDataRPCTime: 222.24us (222241) - UncompressedRowBatchSize: 504 B (504) EXCHANGE_NODE (id=3) - ConvertRowBatchTime: 0ns (0) - InactiveTotalTime: 0ns (0) - RowsReturned: 24 (24) - RowsReturnedRate: 7 per second (7) - TotalTime: 3.02s (3016602849) DataStreamReceiver - BytesReceived: 402 B (402) - DeserializeRowBatchTimer: 0ns (0) - FirstBatchArrivalWaitTime: 1.83s (1830275553) - InactiveTotalTime: 0ns (0) - SendersBlockedTimer: 0ns (0) - SendersBlockedTotalTimer(*): 0ns (0) Exchange and DataStreamSender 55
  • 56. Network slowness § Exchange performance issues - Too much data across network: - Check the query on data size reduction. - Check join order and join strategy; Wrong join order/strategy can have a serious effect on network! - For agg, check the number of groups – affect memory too! - Remove unused columns. - Keep in mind that network is typically at most 10Gbit § Cross-rack network slowness
  • 57. More examples/Exercises - Parquet min/max filter, dictionary filter - Spill to disk - CPU saturated - Scanner thread - Detect small files - Sink (DML queries)
  • 58. Recap: Query Tuning - Performance: Examine the logic of the query and validate the Explain Plan Validate join order and join strategy. Validate partition pruning and/or predicate pushdown. Validate plan parallelism. - Memory usage: Top causes (in order) of hitting mem-limit: Lack of statistics Lots of joins within a single query Big-table joining big-table Gigantic group by (e.g., distinct) Parquet Writer
  • 59. More resources § Impala cookbook https://blog.cloudera.com/blog/2017/02/latest-impala-cookbook/ § Impala perf guideline https://www.cloudera.com/documentation/enterprise/latest/topics/impala_perf_cookbook.ht ml § Perf optimization https://conferences.oreilly.com/strata/strata-ca- 2017/public/schedule/detail/55783
  • 60. 60© Cloudera, Inc. All rights reserved. Thank you Q & A