MySQL Forums :: Newbie :: Question about indexes


Advanced Search

Question about indexes
Posted by: Love MySQL ()
Date: January 29, 2014 11:08PM

I have only been working with mysql for a few years. I developed a web app that over the course of the last few years has grown considerable. Now I find myself going back and re-working bad programming because my server is getting bogged down as the database grows.

Anyway, none of my tables had indexes up to a few days ago. I finally got around to adding a slow-log and realized I had many queries taking over 1 second. I researched and starting adding queries where necessary which cut down considerably on my slow-log.

But I have reached a point where I am not sure how to proceed. I have a table which holds user data. One column is the userid, this is my index right now.

The other columns:
month
day
year
a couple varchar columns that could be anything
a couple float columns that could be anything
3 columns that are 1/0 flag type

I am still getting a few UPDATE queries from this table that are in my slow-log (which I bumped down to 0.5 seconds)

I am still confused about indexes... should I add another index to this table? I guess the next best index would be the year... but I am not sure.

How many indexes should a table have? Is the only downside to having more indexes that it takes up more space?

Thanks for anyhelp.

Options: ReplyQuote


Subject Written By Posted
Question about indexes Love MySQL 01/29/2014 11:08PM
Re: Question about indexes John Smith 01/30/2014 12:01AM
Re: Question about indexes Rick James 01/30/2014 12:26AM
Re: Question about indexes Phillip Ward 01/30/2014 06:38AM
Re: Question about indexes Love MySQL 01/31/2014 10:40AM
Re: Question about indexes Rick James 01/31/2014 05:31PM
Re: Question about indexes Love MySQL 01/31/2014 07:12PM
Re: Question about indexes Rick James 01/31/2014 07:59PM
Re: Question about indexes Love MySQL 01/31/2014 10:14PM
Re: Question about indexes Rick James 02/01/2014 09:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.