Have several very large fact tables (100+ million rows).
In doing some maintainence on one of these fact tables, I can
squish the size of several of my dimension keys from int to smallint.
Don’t want to touch the other fact tables at this point in time.
Is there a performance penalty to having a dimension key in the fact table be
of size smallint but still be of size int in the dimension table when a join
is done?
[B]mikec wrote on Fri, 28 September 2007 04:32[/B]
Is there a performance penalty to having a dimension key in the fact table be
of size smallint but still be of size int in the dimension table when a join
Generally yes, because you are forcing MySQL to perform an implicit data conversion on all records involved in the join.
The question in this case is if the extra CPU cycles outweigh the smaller table size and resulting less reads from disk.
My guestimation is that it doesn’t so I would stick with same type on both columns involved with the join.