I'm aware that in rails we can use a text data type for columns in mysql that we want to save hashes or array to it, where rails serialize the hash in yaml format and save it in the column. class A < ActiveRecord::Base serialize :data, Hash end However if I need to perform some search on this column, I have to load all records and de-serialize all the hashes, and use ruby to search within the hash