List:General Discussion« Previous MessageNext Message »
From:Yonghua.Wu Date:November 28 2006 7:28am
Subject:Re: Should I use an index in this case?
View as plain text  
Hi Andy,

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?

Regards,


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
> "preview".
> 
> 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
> 
> 

Thread
Should I use an index in this case?Andy Sy28 Nov
  • Re: Should I use an index in this case?Yonghua.Wu28 Nov
    • Index effectivity for a 2-valued field (was Re: Should I use an indexin this case?)Andy Sy28 Nov
      • RE: Index effectivity for a 2-valued field (was Re: Should I use an index in this case?)Jerry Schwartz28 Nov
    • Re: Index effectivity for a 2-valued field (was Re: Should I use an index in this case?)Martijn Tonies28 Nov