views:

24

answers:

1

I have a 30M row table, which is indexed by ID now. However, a lot of the requests are around a much smaller subset, which is identified by app_user=1

Does it make sense to physically cluster the table according to this? If so, how can I do so?

+1  A: 

Does it make sense to physically cluster the table according to this?

I think it does make sense, depending on how you select your data. For example, if one of most important use cases for selecting the data is SELECT fields FROM tablename WHERE app_user = something then that will be more efficient if the selected records are all together, i.e. if app_user is the clustered index.

If so, how can I do so?

I think you Google "clustered index" for MySql.

ChrisW
thanks! I think this is what you mean right?http://dev.mysql.com/doc/refman/5.0/en/innodb-index-types.html
ming yeow
@ming yeow -- that's what I found when I Googled, but I can't confirm it from my own knowledge: I don't know MySQL myself.
ChrisW