Ask for Help
“We’re getting id’s from facebook that are overflowing INT columns in mysql tables. Should I use BIGINT to accommodate these ids? Is this wasteful?”
Use string columns instead. VARCHAR columns will only use as much space as the id needs.
“Are VARCHAR columns slower to join than INT columns?”
Not in mysql. Strings do not have join performance penalty compared to integers.
Edward was a guest lecturer for a Carnegie Mellon University course where students are learning to do Agile development. Course work involves pair programming, TDD, and using Ruby on Rails. The talk was well received and Edward is invited to come back next year!
There is an apparent rails bug (2.3.2) when building associated objects and then saving them.
class User < ActiveRecord::Base attr_accessor :bool before_validation_on_create :set_bool def set_bool self.bool = true end end class Child < User belongs_to :adult before_validation_on_create :create_adult def create_adult if adult.nil? self.build_adult() end end end class Adult < User end specify "should work" do child = Child.create!() child.bool.should be_true child.parent.bool.should be_true #fails end