Better HN
topnewbestaskshowjobs
Log inSign up

refset

1,514 karma · joined Aug 24, 2015 (11y ago) · 537 submissions

https://github.com/refset

[ 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

---

Submissions

211.

FAQs about Promise Theory(markburgess.org ↗)

2 points · by refset · 2y ago · discuss

comment 2y ago · link · parent

The actual ISO standard falls well short of being useful/sufficient to anyone who isn't an incumbent player. It's effectively a moat and therefore a direct impediment to competition from teams who have novel technical ideas but don't have access to significant capital - building a SQL implementation is a long, expensive journey. This is why many startups resort to building Postgres extensions, or using Calcite or DataFusion.

If SQL weren't so (needlessly) complex we would see much more competition across the database space.

comment 2y ago · link · parent

> a join is a communication between components

Makes me wonder just how far people have pushed Foreign Data Wrappers in practice.

comment 2y ago · link · parent

Which is fine when everything is handcrafted and human-scale, but as soon as you start going down the path of machine generated SQL (both the generation and analysis thereof) the tax is non-trivial.

comment 2y ago · link · parent

Handcrafting JSON is undoubtedly always a pain, but the idea with XTQL is rather that it can be easily generated from any regular programming language.

> I would actively avoid utilizing any query language where I have to count brackets

That's really an editor/tooling problem, solvable in many ways, but I guess a Python-like/Parinfer approach would be your preference? (where whitespace/indentation is significant)

comment 2y ago · link · parent

> I don’t understand how there hasn’t been more innovation in this space

I think it's simply that most businesses and investors don't register SQL as having any real problems, and especially now with a resurgent interest in SQL the idea of attempting anything novel feels too risky.

Shameless plug of one recent attempt to offer something different: XTQL https://docs.xtdb.com/intro/what-is-xtql.html

comment 2y ago · link · parent

> Lest you think is just one weird corner of the sql spec, I found this helpful diagram explaining how the scoping rules work (from Neumann and Leis, 2023)

It's an excellent diagram, it really conveys the dissonance. Incidentally I interviewed Viktor Leis on a podcast last week about the paper where it's from: https://juxt.pro/blog/sane-query-languages-podcast/

A lot of people seem to believe that LLMs or other ML methods can overcome the complexity challenges of generating SQL accurately, but I'm yet to be convinced that a database-powered AI revolution can happen without somehow bypassing SQL.

218.

SQLPage – Building a full web application with nothing but SQL queries [video](youtube.com ↗)

41 points · by refset · 2y ago · 12 comments

comment 2y ago · link · parent

> Btw, if you have a reference to the creation of Datalog older than the one I linked to, please share it

1982 was as far as I got last time I went digging: https://news.ycombinator.com/item?id=34819400

comment 2y ago · link · parent

> don't have to have two separate worlds for queries and other logic

That's definitely the dream. Another point along that spectrum (from the author of Apache Calcite): https://github.com/hydromatic/morel

comment 2y ago · link · parent

But only if the data is valuable enough to cover the (much) higher costs that come with those assumptions.

comment 2y ago · link · parent

There's more potential applicability/overlap for columnar relational engines (vs. row stores) - this 2023 paper offers some useful background: https://arxiv.org/pdf/2308.08702.pdf

comment 2y ago · link · parent

To add to this description, the Prolog-derived syntactic core of Datalog (the Horn clauses and facts) can be viewed as a combination of "unification" and mutually recursive rules to find a fixpoint over your data+query. It's essentially like solving simultaneous equations.

The Prolog-derived syntax is routinely extended because the core is typically too simplistic/inexpressive to be directly useful, e.g. see https://www.fdi.ucm.es/profesor/fernan/des/html/manual/manua...

comment 2y ago · link · parent

I fully agree with what Prime says at the end - Joran has really set a new bar here for all future database presentations.

Hearing that the entire TigerBeetle domain logic lives in a single file [0] (and is intended to be pluggable for other OLTP use cases!) makes it 1000% more tempting to spend the weekend getting up to speed with Zig.

[0] https://github.com/tigerbeetle/tigerbeetle/blob/main/src/sta...

comment 2y ago · link · parent

The previous interview on this Clojure-in-Banking theme (featuring Griffin [0]) attracted quite a lot of discussion here before: https://news.ycombinator.com/item?id=37313183

[0] https://griffin.com

226.

Clojure in Banking: Treasury Prime(juxt.pro ↗)

2 points · by refset · 2y ago · 1 comment

comment 2y ago · link · parent

Agreed - the main reason I switched to KDE from Gnome was so I could have a vertical taskbar.

comment 2y ago · link · parent

> I much prefer when you start with a big-blob of joins to define the data source before getting into the applied operations

That's essentially the model we've chosen for XTQL, with the addition of a logic var unification scope for even more concise joins: https://docs.xtdb.com/intro/what-is-xtql#unify

Also, anyone interested in this post-SQL space would probably enjoy this recent paper: https://www.cidrdb.org/cidr2024/papers/p48-neumann.pdf

229.

Prototype Compiler from SaneQL to SQL(github.com ↗)

1 points · by refset · 2y ago · discuss

comment 2y ago · link · parent

One such effort: https://github.com/omnigres/omnigres

comment 2y ago · link · parent

"Programming with hand tools" (Tim Ewald, Clojure Conj 2013) is a very memorable talk on this theme: https://youtu.be/ShEez0JkOFw

comment 2y ago · link · parent

According to Wikipedia:

> The original name SEQUEL, which is widely regarded as a pun on QUEL, the query language of Ingres, was later changed to SQL (dropping the vowels) because "SEQUEL" was a trademark of the UK-based Hawker Siddeley Dynamics Engineering Limited company. The label SQL later became the acronym for Structured Query Language.

comment 2y ago · link · parent

Thanks, yes protocol-aware recovery was the context. Pretty sure I first heard it described in Joran's QCon London 2023 talk here: https://youtu.be/_jfOk4L7CiY?t=1460

> If you want your distributed database to maximise availability, how your local storage engine recovers from storage faults in the write-ahead log needs to be properly integrated with the global consensus protocol.

comment 2y ago · link · parent

I would guess so, yes.

comment 2y ago · link · parent

Consensus protocols, durability and transactional semantics are (should be) closely coupled. I recall TigerBeetle discussing somewhere how they could achieve better throughput and durability guarantees by combining replication/recovery with the consensus protocol, instead of layering it above. I.e. disaggregating the log can be expensive. There's a reference in [0] that might elaborate.

> TigerBeetle is “fault-aware” and recovers from local storage failures in the context of the global consensus protocol, providing more safety than replicated state machines such as ZooKeeper and LogCabin

[0] https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/DE...

comment 2y ago · link · parent

I have never researched the timeline properly to understand at which point the concept/code got ditched, but it was part of Stonebraker's 1985 vision: https://dsf.berkeley.edu/papers/ERL-M85-95.pdf

> POSTQUEL allows users to save and query historical data and versions. By default, data in a relation is never deleted or updated. Conventional retrievals always access the current tuples in the relation. Historical data can be accessed by indicating the desired time when defining a tuple variable.

I looked this up during another thread which also has some other sources if you want to dig further: https://news.ycombinator.com/item?id=37956687

comment 2y ago · link · parent

The issue is the complexity of figuring out appropriate JSON-compatible serializations and getting the implementation correct for every single column in use. A simple example would be round-tripping the Postgres money type using salary::numeric and later (user_data->>'salary')::money

A much more complex example would be representing a numrange where you have to preserve two bounds and their respective inclusivity/exclusivity, in JSON.

comment 2y ago · link · parent

It's definitely a reasonable trade-off given the circumstances. Do you know whether Supabase teams who use this extension simply avoid using any non-JSON Postgres types? Or do they lean on workarounds (e.g. JSON-LD encoding)?

comment 2y ago · link · parent

It's especially tragic knowing that Postgres did originally have system-time-like versioning built-in. Instead we get to enjoy being upsold on proprietary ETL-to-Redshift, AlloyDB, etc.
1
789
18