I have a log file, which holds a customerid, and an event type. I want to add a new column called sequence, which should be a increasing number, and should be unique per customer.
The table is append-only, record-by-record, no transactions, and I'd like the sequence number to be computed by a default function on the column. What is the least CPU intensive way to accomplish this?
I tried googling but there are just too many hits on 'auto-increment', 'sequence', and 'serial' for the simple cases.