Two questions for you:
1) Why store so many repeatable data in the same table?
I mean you needn't to store "purchases"/"previews" for all records.
You can choose MySql SET datatype, or you can choose another table to
store the action types and let the original table refers to it.
So that you can reduce the diskspace and also the I/O.
2) I'm afraid the index cannot benefic you much.
Why not use the table partition feature provided by MySql?
Andy Sy <andy@stripped> wrote on 2006-11-28 15:11:07:
> I have a table that is roughly like the below:
> id - PK, autoincremented integer
> name - varchar
> visit - timestamp
> action - char(10)
> Now, 'action', while a char(10), is only ever intended
> to contain two possible values, "purchase" and
> The table might end up containing tens or even
> hundrds of thousands of rows and a report will
> eventually be generated that differentiates
> between "purchases" and "previews".
> Should I still create an index on the 'action' column
> and of how much benefit will it be ?
> Thanks in advance for your help.
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=1