On 8/24/07, yaman 666 [email protected] wrote:
How will you be looking them up without a key, and what do you gain by
not having one?
There’re 2 unique keys for that. Since entries are continuously
entered/deleted - that would be continuous auto-incrementing and
deletion in the sequence table, thousands times a day, which is really
Sequences aren’t that expensive. If you did benchmark and find a
bottleneck, I doubt the sequence and one additional index is why.
If you aren’t already, make sure you bulk all statements that belong
together in a transaction block.
If the amount of insert/deletes is large, consider tweaking autovacuum
settings for that table, and perhaps increase max_fsm_pages to keep
track of all the dead tuples.
So is there any way to actually make ActiveRecord save without needing
You don’t need an id column no, but you do need a PK. See
AR::Base.set_primary_key. Be aware that you need to use YourModel#id
to refer that column.
There are also various plugins you could try if you want a composite PK.
IMO you really shouldn’t go off the beaten path unless you have a
really good reason to, but YMMV…