Primary Key definitions can have a optional symbol value, while Uniques can have both symbol and name. What are these, and what is their differences? And what is best practices to use them?
symbol
is the name of the constraint. Should you later need to drop, disable or re-enable the constraint you identify it to the system using this symbol.
index_name
is the name of an index created using CREATE INDEX
which is to be used to enforce the UNIQUE
constraint. (An index is a database object which is separate from the table it indexes.) If you do not specify the name of an existing index, the system will generate an index for you, and if you later disable the constraint the index will automatically be dropped and must be recreated when the constraint is re-enabled. If you do specify an existing index, it will not be dropped and recreated with the constraint, thus saving considerable time and processing power. Some other platforms also allow you to specify an existing index to enforce a Primary Key.
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With