Procedures

How to use the transitive closure over a set of relations for fast path finding in SQL

published on
In a previous post, I wrote about how we make sense of the world by modelling relationships between things as tree-like hierarchies. This time we will add to this hierarchical data structure, a representation derived by calculating all possible paths. This set of paths is referred to as a transitive closure, and can be thought of as the set of all paths if you start at each node in the tree. Read More...

Wizen up a bit : solve problems bitwize

published on
I’m rather obsessed with bits. All sorts of bits, at various times, but in particular, the digital bit of the Binary system. Notice the capitalization of “Binary” - it is intended. Efficient bit representations of information is purity ; ever more compact representations elegance itself, so for this post I invite you to come with me, way back to 2013, when a nice couple of bitwise operations flaunted their power and expressiveness. Read More...

Speed up slow views through custom materialization

published on
SQL views are aluring as a means of abstraction; a “building block” to hide away commonly used complexity. It is no wonder then that us developers will try them out, and before you know it, your clever recursive CTE view on that hierarchy is used everywhere, by everyone, but how is it affecting overall database performance… They look like tables, can be joined on, selected from, and in some cases even updated just like tables, yet the reality is that they are not like tables. Read More...