database - Re-using rails db :id's -
can re-use rails database record's :id if record deleted?
for instance, if have 5 records id's 1-5 , delete items 2 , 4 database, activerecord use id's again? if so, automatic, or need tell activerecord this? in advance!
the id generation typically function of database using.
sql based databases not able configured reuse id's this, incur huge performance penalty.
activerecord doesn't have configuration perform type of behavior, need implement custom query find lowest id doesn't exist, or have other method of managing freed ids.
it depends on needs, easiest never reuse id's.
Comments
Post a Comment