Jump to content
Server Maintenance This Week. ×

Foreign Key Mapping


sfpx

This topic is 2047 days old. Please don't post here. Open a new topic instead.

Recommended Posts

If we use UUID's for all our key fields can we remove all the relations from the foreign key mapping section ?

If so, would it result in a smaller script and a slightly better performance ?

Link to comment
Share on other sites

The script would not be any smaller, and the performance would not be any better. There is no possible upside of removing the FK's, although if you didn't have the FK's configured to start with, it might not cause problems to skip that step.

With that said, even with UUID's, it's still preferable to configure foreign keys. MirrorSync uses that to determine the order of tables and fields to sync. Inserts and updates are done on parent tables before their children tables. For deletions, the order is reversed - children first, then parents (to avoid triggering cascading deletes, which are relatively slow). Within a table, foreign keys are synced before other field types - if they were synced after other field types, lookup values and auto-enter calcs might have their custom values overridden with default values.

In conclusion, while foreign keys are less critical for UUIDs than serial numbers, there are still important reasons to configure them, and there is no upside to not configuring them.

Link to comment
Share on other sites

This topic is 2047 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.