Do you want to improve the performances of a query?
First step is to retrieve the execution plan:
DELETE FROM explain_plan_table WHERE statement_name = 'marco test nr 1';
DELETE FROM explain_plan_table WHERE statement_name = 'marco test nr 1';
EXPLAIN PLAN SET STATEMENT_NAME = 'marco test nr 1' FOR
select * from dummy; --put here your query!!!
SELECT
table_size,
to_number(output_size, 10, 2) as output_size,
to_number(subtree_cost, 10, 2) cost,
operator_name,
operator_details,
table_name
FROM explain_plan_table
WHERE statement_name = 'marco test nr 1'
order by operator_id;
The output of the last select will look like this in your SAP HANA STUDIO:
In order to read the execution plan, I believe that the most important column is the "Operator Name".
This is the column telling you how the DBMS is approaching the problem.
Here you will see if it is doing something stupid.
The question is: what is the meaning of the content of this column? Here is the set of possible values:
Operator Name | Description |
ROW SEARCH | Starting position of row engine operators. OPERATOR_DETAILS lists projected columns. |
LIMIT | Operator for limiting number of output rows |
ORDER BY | Operator for sorting output rows |
HAVING | Operator for filtering with predicates on top of grouping and aggregation |
GROUP BY | Operator for grouping and aggregation |
MERGE AGGREGATION | Operator for merging the results of multiple parallel grouping and aggregations |
DISTINCT | Operator for duplicate elimination |
FILTER | Operator for filtering with predicates |
UNION ALL | Operator for producing union-all of input relations |
MATERIALIZED UNION ALL | Operator for producing union-all of input relations with intermediate result materialization |
BTREE INDEX JOIN | Operator for joining input relations through B-tree index searches. Join type suffix can be added. For example, B-tree index join for left outer join is shown as BTREE INDEX JOIN (LEFT OUTER). Join without join type suffix means inner join. |
CPBTREE INDEX JOIN | Operator for joining input relations through CPB-tree index searches. Join type suffix can be added. |
HASH JOIN | Operator for joining input relations through probing hash table built on the fly. Join type suffix can be added. |
NESTED LOOP JOIN | Operator for joining input relations through nested looping. Join type suffix can be added. |
MIXED INVERTED INDEX JOIN | Operator for joining an input relation of row store format with a column table without format conversion using an inverted index of the column table. Join type suffix can be added. |
BTREE INDEX SEARCH | Table access through B-tree index search |
CPBTREE INDEX SEARCH | Table access through CPB-tree index search |
TABLE SCAN | Table access through scanning |
AGGR TABLE | Operator for aggregating base table directly |
MONITOR SEARCH | Monitoring view access through search |
MONITOR SCAN | Monitoring view access through scanning |
Source of information:
https://help.sap.com/hana/html/sql_explain_plan.html
Nessun commento:
Posta un commento