Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

how to find tables without indexes in ax

Posted on by 50

Hi i hav a table , if i don't create any index so how can i found which index it wil use and is there any table without indexes

 

*This post is locked for comments

  • Darren Yu Profile Picture
    Darren Yu on at
    Re: how to find tables without indexes in ax

    I think for AX2012, the recid index is always created by default.

  • Suggested answer
    Malcolm Burtt Profile Picture
    Malcolm Burtt 1,475 on at
    Re: how to find tables without indexes in ax

    Hi

    If you don;t define an index then the database will scan the entire table every time you access that table. Always define at least one index.

    If you want to find all the tables in Ax that have no indexes then you can use the following X++ code...

        SQLDictionary   dict;
        DictTable       dictTable;

        ;
        while select dict
        where dict.fieldId == 0 // only tablenames
        {
            dictTable = new DictTable(dict.tabId);
            if ( dictTable.indexCnt() == 0 && ! dictTable.isView() )
            {
                info(strfmt("Table %1 has no indexes", dictTable.name()));
            }
        }

    Regards

    Malcolm Burtt

    HSO ES Limited

     

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans