Jump to content

Naming Indexes


SaranacLake

Recommended Posts

2 minutes ago, Barand said:

I name mine after Harry Potter characters.

However if I create an index without a name using MySQL Workbench it auto names it for me. If I index column yyy in table xxx it gives it the name "idx_xxx_yyy"

So it doesn't sound like you find value in naming your indexes?  (I take the first comment to be sarcasm...)

 

Link to comment
Share on other sites

5 hours ago, SaranacLake said:

Is there a need to know an indexes name so that you can refer to it

There are a few reasons you might want to know the name (index hints, changing the index, etc), but all are fairly rare so it's not really important that you name them explicitly.  If you need the name, you could always look it up later.

I tend to name my indexes and constraints just to be explicit.  I use the format IX_table_name_column_name to keep things simple.

 

  • Like 1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.