When you create a table in rails, does the primary key default to :id?
I am trying to access a row in the table by :id, and it’s taking over 3 seconds to return the result.
The table contains BLOBs on the order of 5-20Mb and whenever I directly reference a row using ModleName.find(:id), the operation takes a long time.
If anyone has suggestions on how to speed up this process I”m all ears
The primary key is the
idby default but it doesn’t mean anyindexhas been created.To achieve that simply add this kind of line in a
migrationfile:See doc here.