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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Table inheritance and indexes

(0) ShareShare
ReportReport
Posted on by 455

Is it possible to add an index that spans the fields belonging to base table and inherited table? Ultimately it's one table in SQL but I can't see how to add such an index. Is it a flaw?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Brandon Wiese Profile Picture
    17,788 on at

    It depends what version of AX you are using.  In 2012 R2 and R3, inherited tables have effectively been removed and all of the data was reduced back into a single table.  The AOT still gives the appearance of inheritance.  CompanyInfo, for example, is not an actual table from the perspective of SQL Server.  You will instead find your CompanyInfo records in DirPartyTable (the root of the long string of AOT based inheritance starting from CompanyInfo), distinguished by RelationType and such.  Thus, in that case any index on CompanyInfo in the AOT can only be applied to DirPartyTable at the level of SQL Server.

    Things are, of course, entirely the opposite in 2012 RTM.

    Hope this helps.

  • Brandon Wiese Profile Picture
    17,788 on at

    Or did I read your question wrong?

  • Alex Kaganov Profile Picture
    455 on at

    Hi Brandon,

    It is AX 2012 R3 CU8.

    Yes, I understand the physical backend is the same table for the parent and all inherited tables. The appearance that AOT presents - multiple AX tables - is what prevents me from adding an index.

    Here's the scenario.

    Base table: EcoResProductMasterDimensionValue

    Inherited table: EcoResProductMasterSize

    I need an index that includes several fields from the base table and the size field from the inherited table. Is there a way to create it in AX?

    I sure can create it directly in SQL but then I get an error during db sync. It's not critical but very annoying.

  • Verified answer
    Srinath Sundaresan Profile Picture
    510 on at

    You will not be able to add the fields from the parent table into the child table index. Although in DB its a single table. AX treats the parent and child as logically separated.

    If you need indexes on parent table fields. I suggest you combine the tables.

  • Alex Kaganov Profile Picture
    455 on at

    That was my suspicion all along. Seems like a flaw in AX.

    Combining the tables would be a very hard path to take in this case. These tables are central to PIM and changing the structure would likely cause a lot of re-write and future upgradability issues. I guess I could remove the inherited table and create a new view instead to alleviate potential code rewrite but even that is beyond the scope for now.

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    I'm surprised that it's not supported, nevertheless it seems to be the case. I suggest you create a feature request on Connect.

  • Suggested answer
    Srinath Sundaresan Profile Picture
    510 on at

    I would suggest to log a bug with support as well.

    What I expect is for it to come back as working as designed. :)

  • Alex Kaganov Profile Picture
    455 on at

    It really is as designed - it's just designed with a flaw.

    Thank you all, guys - it's always good to confirm that I'm not missing something obvious and a negative outcome is still an outcome :)

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans