Good practices Flashcards

1
Q

Best pratices

A
  1. Avoid using Att and Analy views.

2. Avoid mixing CDS views CV.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Unfolding can damage Performance sometimes.

A

Certain time Query unfolding can impact performance.
Such cases we need to add Hint.
Semantics-> Properties->Advanced-> Hint.
For e.g Compilation time can be increased.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SQL Analyser

A

You can check if CV is unfolded , if col view is called that means it is not unfolded.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Not Unfolded

A

M_FEATURE_USAGE.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

JOIN Cardinalities

A
  1. If tables are used , then we can use Propose .

2. Ensure Correct Ness.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Perquisite of Join Pruning

A
  1. No fields from the to be pruned table.
  2. Outer , Ref or text
  3. Join Cardanility is either :1 for to be pruned or only measures with aggregation or no measure at all.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Refrential Join allows Join prunning if

A
  1. No fields from the to be pruned table.
  2. Integrity is placed on not to be pruned.
  3. Cardanilty on to be pruned is :1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Filter Pushdown

A

Ignore multiple output for filer can be set to have filter pushdown.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Joins Recommendations

A
  1. Maintain cardinality of the Join.
  2. Left Outer N:1 or 1:1 and Right outer 1:N, 1:1
  3. Reduce number of Join fields .
  4. Avoid Joining on Calculated fields.
  5. Check Dynamic or Optimise Join can be used.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

List of values

A
  1. faster.
  2. Consistent across views.
  3. Support for analytical priv.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Column Prunning.

A

Add only column that are required in the output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Filtering and Column Calculations.

A
  1. Verify filters are push down.

2, Try to avoid filters on Calculated Columns.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Optimal Aggregations.

A
  1. Try to aggregate as early as possible.
  2. do not switch measures with attributes.
  3. For Star Join use Start join model only , so not mix with sequence of joins.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Cache

A
  1. Can be used for view where there is no Analytical Priv.
  2. Analytics privileges can be assigned on top most view in the stack.
  3. Cache can be done at the Column level , in the cachc add only those columns that are requried .
  4. Cache size can futher reduced with the help of filters.
  5. Retention period of cache in MIN,
  6. It is currently not possible to define the cache invalidation if data is chaneged.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Cache prequsites.

A
  1. enable cache.
  2. CV can be unfolded.( Explain plan in SQL Analyser).
  3. No Granulity tracking calculations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Using the Cache

A
  1. DB hint in the top CV.
  2. Hint is added to query.
  3. Configuration parameter is set.
17
Q

For Parallezation:Partition Local Execution Flag

A
  1. Only project or Aggregation is allowed .
  2. Source col is defined for Partiniong value.
  3. To end , Union is used and property ON.
  4. Always starts with a node that includes Table only.( No Table function)
18
Q

Parallelization

A
  1. No Parallezation Across views.
  2. Only 1 parallezation block per view per stack.
  3. Multiple start nodes can be there but partition should be defined.
19
Q

UNION Pruning

A
  1. Explicit - Adding Constant value.

2. Implicit - Using the Pruning Config table

20
Q

Performance Analysis Mode

A
  1. Need not to activate or build the CV.
  2. Design time warnings and other Information.
  3. Can be switched on all the tabs except Semantics.
21
Q

Performance Analysis Mode examples

A
  1. Type of tables used( Col or Row)
  2. Join details(Type, Cardanility and no of rec in Join.
  3. Partition Details( Tables are partinioned , how they are defined, and number of rec in partitions).
  4. Warnings
22
Q

Performance Analysis Mode warnings

A
  1. large table warnings.
  2. missing cardinalities
  3. Join based on cal view.
  4. restricted col based on Calculated col.
  5. Filters are Pushed down.
23
Q

Performance Analysis Mode does not support Join nodes which consist of multiple Join definitions.
T/F

A

True.

24
Q

Debug Query Mode

A

Check SQL of each step how it is generated, unfiltered i.e all the col from the view.

Can be used for Union Pruning is happening.
Icon is like a bug.

During the Debug Query Mode, cv is only in Read Only , you can not edit it.

The SQL generated , can be executed with the icon near by.

Pruned col are greyed out .

You need to build the CV , only active version /build version you will see Debug query mode.

25
Q

SQL Analyzer.

A

SQL performs.

  1. Total Execution time .
  2. How long each step took.
  3. Bottleneck steps.
  4. How many rec each step process.
  5. Sequence
  6. Operator.
  7. Parallezation.
  8. processing engine,
  9. Unfolding.
26
Q

SQL analyzer can be launched

A
  1. Database explorer.
  2. Right click and analyze SQL.
    Can be used where ever we have SQL for e,g proc and functions.
27
Q

Table partitioning advantages on Col table,

A
  1. Load balancing in distributed system,
  2. Parallezation using multiple threads.
  3. Pruning-Only hits required partitions, hence improving performance.
  4. 2 Billion row limit for each table , Partitions too have
    2 billion row limit , but you can define 16 k partitions.
  5. Improves Delta merge.
28
Q

Table partitions

A
  1. Range.( may or may not have primary key) you define the range.
  2. Hash may or may not have primary key), SAP hana
    computes HASH values.
    3.Round robin( table must not have Primary keys, new rows are assigned on rotation basis.)
29
Q

Table partitions- How to do it.

A

SQL statement.
CDS defination.

Partition is transparent to SQL statement.

30
Q

Table partitions-Features

A
  1. Repartition
  2. merge
  3. add/delete new partitions.
  4. Move partitions to other host.
31
Q

Multi level partitions.

A

Hierarchy of partions.

32
Q

Partitions on ROW store table

A

No

33
Q

Warm Data

A
  1. Native Storage extension(NSE) ( latest uses Disk)
  2. Extension Node( Fastest , need more hardware).
  3. Dynamic tiering,( slowest , uses Multi store tables).