NOT MATERIALIZED

I managed to reduce a PostgreSQL view’s query time by more than 80% with just the two keywords NOT MATERIALIZED and by reading the actual database manual when GPT-4 gave up. Below, I will explain the context of the speedup. I recently moved a little bit of business logic from an API endpoint and into… Continue reading NOT MATERIALIZED

Strange Linq-to-SQL performance when using Count

Yesterday, I was writing a Linq-to-SQL query and noticed a quite remarkable difference in performance between two very similar queries (seconds versus minutes of running time). I thought it would be worth sharing. Basically, I have a bunch of orders that are represented by two SQL tables, called Basket and BasketItem. If an order e.g.… Continue reading Strange Linq-to-SQL performance when using Count