2,204 karma · joined March 29, 2019
I've experimented (see below) with TEMPLATE dbs and such in Python (with inspiration from this library). IMHO the "around 100ms" mark is pretty slow for a big test suite. Interestingly, pg_restore is only twice as slow as TEMPLATEs.
https://github.com/leontrolski/postgresql-testing
I'd be interested about how all this compares to snapshotting the postrgres dir with ZFS and restoring to that, but don't have a Linux box to hand.
I'm trying to compress recipes into little schematics https://leontrolski.github.io/recipes.html
cat = Cat(age=3)
l = [1, [2, cat], 4]
alt l[1][1].age.=9
That would give us l equal to: [1, [2, Cat(age=9)], 4] l[1][1].age:9
# (1,(2,{"age":9}),4)
How come it doesn't return just: {"age":9}
Or is there something totally different going on with references here? As in, how is this different to: l_inner = l[1][1]
l_inner.age:9Currently it feels a bit like everyone is talking about what new editor they're using. I don't care about that type of developer tooling very much. AI isn't coming up with some exciting new database, type system, etc etc.
"Look at how I'm able to web dev x% faster" because of LLMs is boring.
> Pascal did not have sum types because Wirth thought they were less flexible than untagged unions
I'm not sure whether my dream language would have tagged or untagged unions (Scala 3 has both it seems). I'd be interested if anyone has any further points of comparison beyond:
Tagged unions, eg. in Rust: enum Tagged {A(i64), B(String), C(f64)} Untagged unions, eg. in typed Python: Tagged = int | str | float
Tagged unions are better as you can represent duplicated types and types with no data, eg: enum Tagged {A, B(f64), C(f64)}
Untagged unions are better as you can willy nilly create new subsets and intersections of types. I find often in AST-ish work I want to express eg: def f(x: A | B | C) -> A | B
In my linked example, on getting the item from the queue, you immediately set the status to something that you're not polling for - does Postgres still have to skip past these tuples (even in an index) until they're vacuumed up?
Wasn't aware of this AccessExclusiveLock behaviour - a reminder (and shameless plug 2) of how Postgres locks interact: https://leontrolski.github.io/pglockpy.html
IMHO pip-tools was always the far nicer design than poetry, pipenv etc as it was orthogonal to both pip and virtualenv (both of which have been baked into Python for many years now). I would argue Rye is the iterative, standards compliant approach winning out.
Beyond the speedups from Rust, it's nice to have some opinionated takes on where to put virtualenvs (.venv) and how to install different Python versions. It sounds small, but since wheels fixed numpy installs, sane defaults for these and a baked in pip-tools is basically all that was missing. Talking of which, what has been the point of anaconda since binary wheels became a thing?
If I have say 50 workers polling the db, either it’s quiet and there's no tasks to do - in which case I don't particularly care about the polling load. Or, it's busy and when they query for work, there's always a task ready to process - in this case the LISTEN is constantly pinging, which is equivalent to constantly polling and finding work.
Regardless, is there a resource (blog or otherwise) you'd reccomend for integrating LISTEN with the backend?
I have a couple of dbsp questions if you're feeling generous and have 10mins free - reach out ojhrussell at gmail
stepping has 3 Zset implementations - in memory, sqlite and postgres. Currently considering whether to write a small rust one.
There's some more details here: https://stepping.site/docs/internals/how-it-works/
It's based off of the DBSP paper, which counts Materialize's Frank McSherry as an author. Definitely not ready for the prime time, but any feeback welcome!
It has been pointed out that this is apparently similar to Djikstra's algorithm although when it was written the author wasn't aware of that.
The inspiration for the algorithm comes from a solution to a problem set in a mid 1980s edition of A&B Computing magazine.