John Barnette wrote:
> Hi,
> 
> On Fri, Feb 6, 2009 at 11:07 AM, Rasmus Nielsen
> <[email protected]> wrote:
>> MEDIUMINT (as opposed to rails' standard INT in mysql) to save memory
>> consumption on our db-server. When running a test these column is being
>> "maxed out" and hence the tests produce unusable results.
> 
> This sounds an awful lot like premature optimization. :)
> 
>> Should I just accept this fact and change my mediumint columns to int or
>> is there a better way?
>>
>> And on a side-note: why DOES rails "use" so many ids when running very
>> spare and simple anyway?
> 
> Fixtures use sparse, nonsequential IDs that are based on the fixture
> label. This allows a bunch of the nice features of fixtures, like
> specifying relationships by label instead of ID. If you find that you
> *really* need to keep this from happening, just give all your fixtures
> IDs.
> 
> 
> ~ j.

Yes I just found out after playing around with mysql's general log. 
Thank you for your reply anyway!

I've decided to change the problematic column data types to int(11) - 
rails' default for mysql. The reason I made the (premature) optimization 
in the first place was that I thought it would be no biggie to just use 
smaller integer data types and that it would have no impact (other than 
lower memory consumption) - that was not the case :)
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to