I am working on building a small Mysql database for our team. For two tables in my db, I used the same index name.
Would there be any performance hit?
I did a few tests queries (800,000+ rows) and so far, so good.
Yep, indexed views are the answer. You can join the two tables in a view and create a unique clustered index on the view for the required columns.
You can have tables of the same name only if they are in separate databases, and you use the database name as a qualifier.
Yes, it can have an effect. Of course the two indexes take extra space on disk and also in memory if they are used.
Index names are specific to each table. You cannot have two indexes of the same name in one table, but you can have many indexes of the same name, one for every table. Index names are irrelevant for day-to-day performance. They're simply there to provide a nice user-friendly way to refer to the index without having to list all the fields in the index. e.g. it's easier to say alter table XXX drop key friendlyname
than alter table XXX drop key (field1, field2, field3, field4, field5, etc...)
Index names are per table, there shouldn't be any concern.
No. The index name is completely inconsequential to performance.
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