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

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -