cofoundry-cms / cofoundry

Cofoundry is an extensible and flexible .NET Core CMS & application framework focusing on code first development
https://www.cofoundry.org
MIT License
836 stars 146 forks source link

CustomEntity ID generation #417

Closed JornWildt closed 3 years ago

JornWildt commented 3 years ago

This mostly a curiosity question ... during a work session where I was adding and deleting custom entities, the custom entity ID range suddenly jumped from around 70 to 1071 - and I am pretty sure I didn't randomly add and delete 1000 custom entities. So I was wondering - how is the custom entity ID generated? I don't see an auto-increment column in the database?

HeyJoel commented 3 years ago

Actually, it is set up with an auto-increment id, the behavior you see if actually a performance feature of SQL 2012+, as explained in this SO answer.

It's something I had also noticed but hadn't looked into, so I learnt something new today =)

JornWildt commented 3 years ago

Thanks 👍 Then I learned something too. It fits rather well with Windows rebooting the same day.