February 2020
Intermediate to advanced
734 pages
38h 13m
English
Remember how we mentioned that timeshard sequence fields are bit-packed 64-bit integers? Well, BDR includes functions that make it possible to unpack a value to obtain the information it contains.
Let's try this by using the following query to unpack the event_id field in the event_log table:
SELECT event_id, bdr.extract_nodeid_from_timeshard(event_id) AS node_id, bdr.extract_localseqid_from_timeshard(event_id) AS seq_val, bdr.extract_timestamp_from_timeshard(event_id) AS stamp FROM event_log;
If we insert one or two more rows from each of our nodes, we should see something like this:

With this technique, we can actually ...
Read now
Unlock full access