indexing - Why most SQL databases allow defining the same index twice? -


Why do most SQL databases allow to define a single index (or constraint) twice?

For example in MySQL I can:

  Make Table Tester (id VARCHAR (10) Faucet, Primary Key (ID)); Optional table testkey plus key (id); Optional table testkey plus key (id); Create Table Tester; Create tab 'Tad kaki' (`id` varchar (10) tap, primary key (` id`), key `id` (` id`), key 'id_2` (`id`))   

I do not see any use to get the same index or hurdle twice. And I would like the SQL database not allow me to do this.

I do not even see the names or names of the barriers, because I can refer to them for reference to remove them.

Many reasons come to mind in the case of a database product that supports several index types, It is possible that you want a combination of indexed fields of the same field or multiple times, depending on the different ones used with each index. For example, some (probably the most) database products have a tree-structured index for both straightforward lookups (for example KEY_FIELD = 1) and border scans (such as KEY_FIELD> 0 and KEY_FIELD <5) that's good. In addition, some (but not all, of course) database products also support a handy index type, which is useful only for direct lookup, but which is very fast (like working for a comparison like KEY_FIELD = 1 , But it can not be used to compare a limit) If you need fast looking time but still need to provide it for comparison then it can be useful to create both a tree-structured index and a palm indicator.

Some database products have several primary key constraints on a table, however, it requires more effort on the part of the database vendor to prevent all possible duplicates, because they think it may be appropriate. In the case of an open source database, major developers believe that if a given attribute is a great deal for a user, then that user should have the facility to send a code patch to it. Wanted. Open source "I use your open source product, so you are now my slave and I should apply every feature as usual."

In the end, I think it is fair to say that a product for use by software developers should expect it to take proper care during the use of the given product.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -