Top Banner
Einstein Analytics - Design for Performance ACE Mini Series (Episode E43) Level: (Intermediate) [email protected] Terence Wilson, Sr Solution Architect ACE
20

Level: (Intermediate) ACE Mini Series (Episode E43 ...

Dec 26, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Level: (Intermediate) ACE Mini Series (Episode E43 ...

Einstein Analytics - Design for PerformanceACE Mini Series (Episode E43)Level: (Intermediate)

[email protected] Wilson, Sr Solution Architect

ACE

Page 2: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEACE

Forward-Looking StatementsStatement under the Private Securities Litigation Reform Act of 1995:

This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Page 3: Level: (Intermediate) ACE Mini Series (Episode E43 ...

Analytics

ExpertiseInspirationInnovation

ACEDesign for Performance

Abstract

Learn how to design your dashboards and model your datasets for optimal

performance. What traps to avoid and which tools and approaches to investigate

issues and apply best practice solutions.

Page 4: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEBefore you start

Save yourself a great deal of pain and set expectations by:

● Designing for performance as a priority requirement, not an afterthought.

● Build performance testing and criteria into the User Story; Point

appropriately. Baseline perf tests so it does not become anecdotal.

● Don’t let features and functions get out there in the wild without first passing

performance criteria.

● Think about future scale, if you are testing on smaller datasets

Page 5: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACE

Delivering Successful EA Projects

What is a Dataset ?

Data Repository (Storage) similar to file system storage but with proprietary format and algorithms flattening the data with inverted indexes (for volume and speed). READ only

TextNumberDates

Traditional Data Structure(Tables)

Flattened Indexed Key Value Pair Structure(Files not Tables)

Account

Opportunity

UserProduct

Leads

Product

Leads

User

The Dataset is the core of EA

Page 6: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACE

Dimensions comprise the inverted index, in that dimension values points to one or more records.Measures are scalar and by their nature are individual to each record.Date Types are decomposed into Dimension Values as date parts and Measures (epochs)

Flattened Indexed Key Value Pair Structure(Files not Tables)

Dimensions Files (.dim)

Index files (.idx)

Measures Files (.mea)

json files (.json)

Key Value

Carrier:AA 1,2,9

Dest:ORD 1,8,9,10

Carrier:WN 3,4

Carrier:UA 5,6,7,8

Carrier:DL 10

Origin:SFO 1,2,8

etc.

Miles

1200

350

1200

1500

1500

1500

1600

1200

1100

1100

Dataset Inverted Index

Page 7: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACE

Dimensions and Measures files are loaded into Memory from the initial query and become cached available for subsequent queries from any user in the Org.

Dimensions Files :Account_Type.dim

Customer_Number.dimProduct_Family.dim

Index files (.idx)

Measures Files:Total_ListPrice.mea

json files (.json)

q = load "Sales";q = filter q by 'Account.Type' == "Corporate"; *q = group q by ('Customer_Number', 'Product.Family');q = foreach q generate 'Customer_Number' as 'Customer_Number', 'Product.Family' as 'Product.Family', sum('Total_ListPrice') as 'sum_Total_ListPrice';q = filter q by 'sum_Total_ListPrice' > 250000; **q = order q by ('Customer_Number' asc, 'Product.Family' asc);q = limit q 2000;

Sales

* Index filter is used as it is dimension pre projection. Even Measure filters are not index here** Non indexed as it a Measure. Also at this point it is post project and Any filter is non index

Dataset Inverted Index

Page 8: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACE

Delivering Successful EA Projects

Modelling the Dataset for Einstein Analytics

Avoid lots of discrete entities as datasets, augment and widen the dataset to encapsulate dimensions

from many entities. This will reduce complexity of queries, improve query execution performance and

ease maintenance of queries and dashboards

Notwithstanding the above, curate the dimensions/measures being added , this

avoids noise and, particularly measures in large scale datasets, performance issues.

Sales Tx Wide40 fields400 MM

Sales Tx 15 fields400 MM

Customers 15 fields

5 MM

Events5 Fields

2 MMProducts10 Fields

200K

Modelling the Dataset

Page 9: Level: (Intermediate) ACE Mini Series (Episode E43 ...

Rendering Engine

Query Engine Dataset

Einstein Analytics Dashboard - How it works ?

Page 10: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACE

Pages

Widgets

Steps

DatasetStatic ValuesSOQLApex

Global Filters Visualizations

Anatomy of a Dashboard

Page 11: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACE

Delivering Successful EA Projects

Dashboard Query Execution and Results

Dashboard Query Execution and Results

Page 12: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEGetting the InformationTools to inspect the dashboard and test speed

Chrome: Menu > More Tools > Developer Tools > Network Tab

• See the waterfall showing the batches of six queries.

• Type ‘query’ into the filter box , showing how many actual queries are invoked.

• Consider how local cache works.

EA Dashboard Inspector• 1st Run• Focus on a step and look at the detail. Note last run time.

Network and browser performance• <your org url>/speedtest.jsp

Page 13: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACE

Delivering Successful EA Projects

Query Steps and DB Inspector

Queries are executed 6 at a time, standard browser concurrency

Query Steps and DB Inspector

Page 14: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEReduce Number of Queries in the Dashboard

Reduce the number of queries sent to the engine by:• Think about the Use Case. Reduce the number of filters, visualizations to what is needed, think of the

journey through the dashboards.

• Use Pages as only those queries appearing on the page will be executed.

• Rationalize queries of the same filters and groupings to drive more than one widget.

• Reduce the need for results binding where you can by modelling logic into the dataset.

• Use Global Filters, they do not require a query to the engine to populate the dimension values.

• Replace selection filters that have start values , with either static or global filters. To prevent unnecessary

query invocation.

Page 15: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEImproving Query Performance

Improve the execution time of an individual query by:• Reduce the size (rows) of the dataset . Obvious but still true.

• Width and high cardinality fields do not have such an impact, but reducing number of fields is good

practice.

• Filter pre projection.

• Change measure filters or range filters, into dimensions filters in the dataflow.

• Use multi values for filtering only. No operations such as unique(multivaluefield).

• Avoid redundant filter logic.

q = filter q by 'Lab_country' == "USA";

q = filter q by 'Lab_city' == "Salt Lake City"

• Avoid Matches in queries move to the dataflow and create a flag.

q = filter q by 'Comments' matches "test"; ❌ q = filter q by 'IsTest' == "true";✓

Page 16: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEImproving Query Performance

Improve the execution time of an individual query by:• Try to avoid results binding on large numbers of values, this can lead to large ‘in’ statement: q= filter q by

SomeDim in [ value1... value100 ,value 101] which can be too large for the payload particularly mobile

• Model both datasets with augments of filters from each side using lookupMultivalue where necessary.

• Dataset link the datasets for faster filtering.

• Push complex filter logic to dataflow where possible to create simpler flags, during query time. (Same

goes for Security Predicates).

'Accnt.Territory' ==”$User.Territory__c” && ('Accnt.Yearly_Revenue__c' >100000000 ||

'Accnt.Personnel_Count_c' >1000)

Do this instead:

'Accnt.Territory' ==”$User.Territory__c” && 'Accnt.Business_Level__c' ==”SME”

Page 17: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEImproving Query Performance

For large external data files, order the data to be uploaded by the most likely

group by, or filtered value:○ For example if you wish to show timeline trends, order the upload data file by the date to be

grouped by in chronological order.

○ Or order the data file by the most likely first few filters for example Region then Country

This is in readiness for the upload so that the index process produces the most

optimized byte code for those queries

Page 18: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACEA ReminderReiterating:

• Tackle performance requirements early.

• Don’t just chase features in sprints to show ‘progress’. Your end users will not

thank you.

• Rework is always more expensive than tackling these issues early.

• Think about future scale, try to get access to larger datasets early.

• Fixing performance is not a bug, it should be part of every user story.

Page 19: Level: (Intermediate) ACE Mini Series (Episode E43 ...

ACENEW: Official Certification for Einstein Analytics NEW!

Start here:

sfdc.co/ea-cert

First official certification

Prove your professional expertise

Advance your career in analytics

Perfect for: EA experts, BI pros

Page 20: Level: (Intermediate) ACE Mini Series (Episode E43 ...