Databases and B-Trees: What are Keys and how are they related
There's an indeed a relation that maps the database keys to the B-trees keys $K_d \mapsto K_b, K_b \in \mathbb{Z}$
The B-Tree keys are not random though, they represent the physical location of data stored for that key.   At the leaf level there are multiple ( up to the order of the tree) database $K_d$s associated with a single $K_b$ key. The relation is thus not an injective function.