I want to know how to efficiently store query-affecting settings in a large analytical database (MS SQL Server). By efficiency I mean no hardcode (1) and fast/optimal query processing (2).
My example
I've got a massive table of sales orders. Let's simplify it to two columns:
SalesOrder
OrderI...
I have a several SQL objects that need to take alternate actions based on a desired state of the request. Is there a way to create database level constants (enumerations) that can be passed to stored procedures, table-valued functions, and used in queries (without using CLR)?
CREATE PROCEDURE d...
I guess my thought process is the concept of a JOIN is obviously part of relational theory, but I'm not sure if a subquery is, as a construct, or only exists as a concrete implementation in query languages. Or if it is, using one specifically as the predicate to a WHERE clause feels more like a concrete implementation of code / kinda hacky. Hence JOIN being "more relational" of a solution, in my mind.
But I'm definitely no expert on relational theory, so do feel free to call me an idiot. 🙂
I use my phone 99% of the time on this site, so much so I've added "https://www.brentozar.com/pastetheplan" as a word in my phone's keyboard dictionary lol.
Mr. Foch didn't even need hindsight (even if he probably was wrong about the possible solution) as in 'This is not peace. It is an armistice for twenty years.'
The read committed snapshot and snapshot isolation levels in SQL Server do away with most locking except one: A writer still locks out other writers.
The documentation tiptoes around saying as much and subsequently doesn't document anything else which would be very interesting to know:
Is it real...
It's fun to find 'inconsistencies' under anything less than complete isolation. Locking read committed is near the bottom of the hierarchy, so it's a relatively target-rich environment.