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)

Create RecID index on Table

(0) ShareShare
ReportReport
Posted on by 30

Dear All,

As I know that on Table, create RecID index is set to Yes is part of BP.

If I create new index under index like "StudentIdIdx" and also set "CreateRecidIndex" set to Yes then which one will work?

Because both are index.

Please give me more shed on this.

Thanks!

Arpan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    RecId index is the surrogate key provided by the system. What is the nature of your studentIdIdx like mandatory to yes/no, allow duplicates to yes/no, clustered/non-clustered index. Usage of index is choosen by the databased engine based on the fieldlist provided in the where clause of the query. Even though both are indexes it doesn't mean the nature of indexes are same.

  • @rp@n Profile Picture
    30 on at

    Thanks Chaitanya

    As I understand , RecID index is actually provide us speedup to fetch record from database and

    " StudentIdIdx" if I set allow duplicate NO, then it will not allow duplicate records.

    If "StudentIdIdx " allow duplicate set to Yes then it will allow us to enter duplicate records nothing more than that.

    Is't correct?

    Please give me more shed on this.

    Thanks!

    Arpan

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    As I mentioned RecId index is a surrogate key i.e default primary key(index) provided by the database. Primary Index is one where AllowDuplicates is set to No and Mandatory is set to Yes. Yes, if you set allow duplicate to yes on index studentIdIdx it will allow duplicates else not, it depends on your table and index design.

  • @rp@n Profile Picture
    30 on at

    Thanks Chaitanya

    So, if I set CreateRecidIndex = Yes then Primary index should be "Surrogate key" default.

    If set to No, then I can use any other primary key instead of Surrogate key.

    Is't correct?

    Please give me more shed on this.

    Thanks!

    Arpan

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Its recommended to set this property to Yes, as database engine will use surrogate key in case of some complex queries. You can have primary index, by setting the property PrimaryIndex to name of your Index even though createRecIdIndex is set to yes.As far I know its fine to have both.

  • @rp@n Profile Picture
    30 on at

    Thanks Chaitanya

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Just for an example you can check these properties on SalesTable where CreateRecIdIndex is set to Yes and PrimaryIndex is set to SalesIdx.

  • @rp@n Profile Picture
    30 on at

    Thanks Chaitanya,

    Yes, Surrogate key(RecId) is used by database engine based on property "CreateRecidIndex" set to Yes or No and Primary key will work based on index property which we have set.

    So, both are working together based on his own nature.

    Right?

    Thanks!

    Arpan

  • Verified answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Yes.

  • @rp@n Profile Picture
    30 on at

    Thanks Chaitanya

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