MySQL Forums
Forum List  »  Newbie

Re: indexing on every column?
Posted by: Ben Hunter
Date: November 20, 2009 10:42AM

I was doing some research (because I'm trying to do the same things myself) and I have to retract some of my statements.

I thought I read somewhere that varchar(30) was better than varchar(255) in either performance or storage, if the largest string is 30 characters. I can't find this information again, and the stuff I'm reading seems to indicate that it doesn't necessarily make a difference (for values less than 256). Does an expert know for sure?

Also...I think the 'Fixed Width' row optimization would only apply to MyISM tables, not InnoDB. Or at least would do more for MyISM than InnoDB.

If you do create a couple of extra indexes, you could also configure the server/table to delay index flushes, so it will do a batch write to disk instead of a disk write every update.

And I'm wondering if a compound id,start_date index would help with the particular query you mentioned. Though if the ratio between id and start is small, it might be more effecient to just index on id. I guess some tests would say for sure.

Sorry...don't know any "just do this" solutions. Again...good luck!

Options: ReplyQuote


Subject
Written By
Posted
November 19, 2009 07:06AM
November 19, 2009 07:09PM
November 19, 2009 09:29PM
November 20, 2009 02:17AM
November 20, 2009 07:11AM
November 20, 2009 07:17AM
Re: indexing on every column?
November 20, 2009 10:42AM
November 22, 2009 01:38PM
November 22, 2009 04:13PM


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.