Great news! Having to reconnect the USB cable each time is no fun.
1,510 karma · joined August 24, 2015
[ my public key: https://keybase.io/refset; my proof: https://keybase.io/refset/sigs/pyTK0thu8g5O4Zs7EA3HrQYKkYZjeEz_TUr8nZV2hlY ] c0ba44896414421c9009bc8a77a86ceb
meet.hn/city/51.0612766,-1.3131692/Winchester
Socials: - github.com/refset
---
Great news! Having to reconnect the USB cable each time is no fun.
XTDB is perhaps not directly relevant to the topic at hand, but I am a firm believer that ML workflows can benefit from robust temporal modelling.
In my experience, usually along the lines of "what was the state of the world?" (valid-time as-of query) instead of "what was the state of the database?" (system-time as-of query).
While not quite in rustc proper, along these lines: https://github.com/rust-lang/chalk + https://github.com/rust-lang/polonius
Many implementation options were considered before we embarked on v2, including building on Calcite. We opted to maximise flexibility over the long term (we have bigger ambitions beyond the bitemporal angle) and to keep non-Clojure/Kotlin dependencies to a minimum.
XTDB doesn't currently solve the problems of user-defined projections (via stored procedures, triggers, Incremental View Maintenance etc.) or multi-partition scaling.
It seems to me that the way recursive CTEs were originally defined is the biggest reason that relational databases haven't been more successful with users who need to run serious graph workloads - in Frank McSherry's words:
> As it turns out, WTIH RECURSIVE has a bevy of limitations and mysterious semantics (four pages of limitations in the version of the standard I have, and I still haven't found the semantics yet). I certainly cannot enumerate, or even understand the full list [...] There are so many things I don't understand here.
https://github.com/frankmcsherry/blog/blob/master/posts/2022...
And for more context on Efrit this is a fun watch: "When Steve Gives Claude Full Access To 50 Years of Emacs Capabilities" https://www.youtube.com/watch?v=ZJUyVVFOXOc
Lotus Notes was the original offline-first everything app, including cutting edge PKI and encryption. It worked over dial-up and needed only a handful of MBs of memory (before the Java rewrite at least). Has anything else really come close since?
i.e. it would be `SELECT * FROM orders FOR SYSTEM_TIME AS OF "@seq:1000" WHERE customer_id="cust1"` rather than `SELECT * FROM orders WHERE customer_id="cust1" AS OF "@seq:1000"` (the latter being an example from the DriftDB readme)
[0] https://docs.xtdb.com/reference/main/sql/queries.html#_tempo...
The output format is either raw Arrow DenseUnions (e.g. via FlightSQL) or Transit via a pgwire protocol extension type.
In a bitemporal database, every regular looking join over the current state of the world is secretly an AsOf join (across two dimensions of time), without constantly having to think about it when writing queries or extending the schema.
Wait no longer! I just updated the page with the unlisted video link: https://youtu.be/6Q_pAI20QPA
We are hoping to record another (more polished) session with Professor Snodgrass soon :)
CREATE VIEW IF NOT EXISTS world_facts_as_of_now AS
SELECT
rowid, txn_time, valid_time,
e, a, v, ns_user_ref, fact_meta
FROM (
SELECT *,
ROW_NUMBER() OVER (
PARTITION BY e, a
ORDER BY valid_preferred DESC, txn_id DESC
) AS row_num
FROM world_facts
) sub
WHERE row_num = 1
AND assert = 1
ORDER BY rowid ASC;
...cool approach, but poor query optimizer!It would be interesting to see what Turso's (SQLite fork) recent DBSP-based Incremental View Maintenance capability [0] would make of a view like this.
[0] https://github.com/tursodatabase/turso/tree/main/core/increm...
> A semantic layer, also known as a metrics layer, lies between business users and the database, and lets those users compose queries in the concepts that they understand. It also governs access to the data, manages data transformations, and can tune the database by defining materializations.
There's also now a paper: https://arxiv.org/pdf/2406.00251