PostgreSQL Antipatterns: CTE x CTE
In my line of work, I often encounter situations where a developer writes a query and thinks, "the database is smart, it will handle everything!" In some cases (partly due to a lack of knowledge about the capabilities of the database, partly due to premature optimizations), this approach leads to the creation of "Frankensteins." First, I will provide an example of such a query: — for each key pair, we find the associated field values WITH RECURSIVE cte_bind AS […]
