Investigate using semantically meaningful UUIDs as primary keys for all of our tables #148
Labels
No Label
bug
critical
duplicate
enhancement
epic
help wanted
in progress
invalid
low priority
question
rebase
v1
v5
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/go-ethereum#148
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Aka for tables where CID is unique, we can use the CID as the primary key. For tables where CID is not unique we need to be a bit more clever (e.g. for state_cids we can use the CID of the header_cid record we FK reference + the path of the state node).
The primary motivation is that these can serve as universally unique ids, enabling us to painlessly merge databases that were constructed in parallel.
Other pros:
Cons:
Proposed scheme:
header_cids: use CID
uncles_cids: use CID
transaction_cids: use CID (or alternatively, use referenced header CID + index)
access_list_element: use referenced tx primary key (defined above) + index
receipt_cids: use FK reference to tx primary key (defined above) (mapping is one-to-one so we can use FK as primary)
log_cids: use referenced rct primary key (defined above) + index
state_cids: use referenced header primary key (defined above) + path
state_accounts: use FK reference to state primary key (defined about) (mapping is one-to-one so we can use FK as primary)
storage_cids: use referenced state primary key (defined above) + path
Moved it here https://github.com/vulcanize/ipld-eth-db/issues/16