Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

When we need to add Partition and DataAreaId fields to index?

(0) ShareShare
ReportReport
Posted on by 1,869

I was improve a form and I tried modifing primary Index.

Table is SalesTable and index is SalesIdx but when I test on sql I recieve a stadistics that make me doubt if is necessary to add Partition and DataAreaId.

Current index fields order is Partition, DataAreaId and SalesId.

When I execute a query on sql I recieve this information:

In where clausere only salesId field.

1157.1.png

Next step using all fields of index with right order.

4762.2.png

With this stadistics I suppose that is better use less fields on where clausure.

Then I add partition and dataAreaId and order index with salesId, Partition, DataArea.

i sincronize salesTable and refresh table on sql to see the new order on sql.

286340.3.png

And finally I decide to call where with only salesId field with the new order.

0552.4.png

for more times I execute query I never get a better result of first execution, so my question is when we need to add partition and dataAreaId fields to an index?

For your information in my company we have several companys but only one partition

Regards

*This post is locked for comments

  • XB Profile Picture
    XB 1,869 on at
    RE: When we need to add Partition and DataAreaId fields to index?

    Thanks Sefa for your answer but still I'm doubting if it necessary add this field because when I execute queries with sql tools improve is worst with this new fields.

    I'll try to install a tool to analize queries perfoms

  • Suggested answer
    Sefa Duman Profile Picture
    Sefa Duman 1,167 on at
    RE: When we need to add Partition and DataAreaId fields to index?

    Hi,

    When an index is created on a table in AOT you select the fields to include in the index. The system will then synchronize this index with the database server creating or updating the index in SQL. And the system automatically adds the partition and dataareaid, if the table is not shared, into the index.

    Actually there is no exact rule for adding partition and dataareaid manually to indexes on AOT. AX queries must be analyzed by a DBA periodically

    from SQL tools or DynamicsPerf. SQL server may recommend new missing indexes or changing index order. You should change index order based on these recommendations.

    In so far, Most implementations only have a single AX partition and many implementations only have a small number of companies.

    If these are true, and your tables has many thousands of records, or more, then the index will not work very efficiently by default. You should consider add dataareaid and partition field at the end of your index on AOT as much as possible. So that identifier field like PurchId will be placed at the top of index and index will be able to find the data quicker.

    If you want to use DynamicsPerf for this purpose, you can use scripts below in DynamicPerf SQL solution:

    4-Analyze_SQL_Indexes

    5-Analyze_SQL_Queries

    Best regards,

    Sefa.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans