Sample Header Ad - 728x90

Does making a field unique make it indexed?

11 votes
3 answers
11102 views
If I make a unique constraint on a field, do I also need to make an index on that field in order to get a scalable insert time? Or is this done for me (even if the index it uses isn't publicly accessible?) Specifically, I'm working with Apache Derby for prototyping, although I will probably be moving it to MySQL in the semi-near future. I'm also hoping there might be something in the SQL standard that says something about this. I will never have a need to search by this field, so I would rather not make a useless index. But I'd rather have a useless index than have an O(n) insert time.
Asked by corsiKa (213 rep)
May 17, 2011, 10:36 PM
Last activity: Jan 31, 2024, 06:43 PM