On Thu, 31 Jul 2008 13:57:07 -0400, "Perrin Harkins" <[EMAIL PROTECTED]> wrote: > On Thu, Jul 31, 2008 at 12:59 PM, Chris W <[EMAIL PROTECTED]> wrote: >> So my question is, is doing that way better than making the query more >> complex with all the joins? > > If by "better" you mean "faster" then yes, it probably is marginally > faster. It would be simpler to just use the actual values you want in > the lookup columns rather than integers. It might slow down writes a > little (since the foreign key lookup would be a string instead of an > integer) but it eliminates joins for reading. The downside is > duplicated data.
Hi Perrin, How would you get duplicated data? In one case you have an integer and in the other you have the value, but you still have to store one token of information with the row. And if you think about it, say for the case of state code, it would take 16 bits to store the two letter state code vs. 16/32/64+ bits to store the lookup integer (assuming that you used char(2) (8bit chars) and integer columns). -r -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]