It's certainly a related question, but I would un-close it as a duplicate if I saw you do that. One of the frustrations here is people asking perfectly decent 'related' questions in comments instead of as actual questions.
I still think the optimizer is masquerading online as @PaulWhite, I mean how on earth does one go about writing this article for instance sqlperformance.com/2021/11/sql-performance/… ?
Not everything is done with rules. There used to be a separate stage (hard-coded, not in rules) for NNF convert, but in modern times it's implemented in the parser.
And they still don't have JSON_AGGJSON_OBJ_AGG or XML_AGG
@PaulWhite Interesting. I wonder if that would ever make a difference, eg the parsing stage happens when you CREATE a function or proc, rather than at (re)compile time
It's a mature code base now so there are bits and pieces all over the shop. There are some normalization rules and some extra snippets in index- and computed-column-matching logic.
It's handy to think of things as all neat and tidy when explaining concepts, but the reality of any real product is usually pretty different.
For example, people think of constant-folding as a thing that happens once at a particular point in the compilation sequence, but it's not. Sure, there's one comprehensive run at the start, but as you go along its frequently necessary to re-fold new derivations.
In seriousness, most of the things I write about these days are things I'm curious about or people I talk to are. I research them and write them down to avoid forgetting.
I think the adaptive threshold was something Erik was curious about
> A read operation on a large object failed while sending data to the client. A common cause for this is if the application is running in READ UNCOMMITTED isolation level. This connection will be terminated.