web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to read the estima...
Finance forum

How to read the estimated execution plan of a view

(0) ShareShare
ReportReport
Posted on by 1,461

We have custom on the advanced product search (form: MCRSalesQuickQuote). It runs a bit slower than the standard.

I came across the following link on how to determine if a view is missing an index:

https://kaya-consulting.com/view-slow-maybe-sql-missing-index-can-help-you/

One of the datasources in this form is a view called: MCRSalesQuickQuoteSumUnion.

So I tried the above link's suggestion to create a estimated execution plan on this view. It didn't indicate that it was missing an index. So that is good.

There are Hash Match with a cost % and then there are "Index seek (nonculstered)" with a cost %. InventDim had a cost % of 18% and InventSum had a cost % of 15%.  I added some indexes on these 2 tables by hovering my mouse over the diagram for the specific table and it gave me the Seek Predicates. I added an index according to that. I got InventDim down to 8% and InventSum down to 7%. However the hash match cost % went up from 9% to 13%.

So, did I accomplish something or did I just shifted the cost from invetnSum and InventDim to the hash match. I'm not an SQL expert (my experience lies more with the Progress database).

I will really appreciate it if somebody can explain the difference between the hash match cost and the actual table cost for me so that I can figure out if it is really worth adding the 2 extra indexes on InventDim and InventSum

I have the same question (0)
  • Retha Profile Picture
    1,461 on at

    I did some research and it looks like the hash matches are good for big queries. It is very expensive on startup because it uses a lot of memory to build the hash table. One actually wants to see "Index seek". So I have removed my 2 indexes that I have created so that the Hash Match can be lower and the Index Seek higher as it was originally. Our problem is that the startup is slower with the custom in place, so using more hash that has an expensive startup, will have the opposite effect of what I wanted to accomplish.

    dba.stackexchange.com/.../execution-plan-basics-hash-match-confusion

    blog.sqlauthority.com/.../sql-server-index-seek-vs-index-scan-table-scan

    blogs.msdn.microsoft.com/.../hash-join

  • Jie G Profile Picture
    Microsoft Employee on at

    The execution plan is complex and has more details with SQL. I'd suggest you to ask for help in the SQL forum.

  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    Percent should always make 100%, therefore if one part starts taking less time, the other will start taking a bigger part of the overall execution time (higher percentage).

    You accomplished something if you reduce the time of execution. Percents show merely how the time was distributed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans