MySQL Indexes

(For Server Users).

You can speed up some MySQL options(specifically sorting) by adding an index on a column that is often used. There’s a downside of course. Some other functions (adding or changing metadata) will slow down. As MySQL now not only has to update the table with the metadata but the index as well.

To do this, you need to connect to MySQL. You can use an app like Sequel Pro to connect to MySQL. After selecting the database, click on the structure icon in the toolbar, then down at the bottom you’ll see a list of indexes.

Index

After clicking on the + to add a new index, you can choose the field to add an index onto. The defaults work fine.

CreateIndex

MySQL has a limit of 1000 bytes on an index, so if you get an error when creating, you’ll need to specify a size. 300 works. (As some characters take up more than 8 computer bytes, so MySQL is conservative.). Of course, sometimes Sequel Pro won’t show the size column, so a workaround is to do it via a query.
create index descriptionindex on metadata (Description(300));

The indexname can be anything you like, I just use the fieldname and tag an “index” after the name to keep things simple.




We don't actively monitor comments. Always best to email us for proper support.