Hi Claire, thanks for reaching out. Maybe you could try encoding RA and Dec (possibly in conjunction with other fields) into a unique ID? Both RA and Dec are DOUBLE PRECISION, so hopefully have enough significant digits to be unique even in dense regions.
Another option would be to simply enumerate all objects (with a BIGINT). Not sure how expensive such an operation would be though...
Robert