« first day (4517 days earlier)      last day (647 days later) » 
00:00 - 20:0020:00 - 22:00

00:26
They read the log directly using an unsupported function?
00:43
I’ve seen a few things do that
I had a client at one point who wrote their own scripts to do that
It was not very successful
01:43
I wonder how it'll work with computed columns, filestream, instead-of triggers, and Azure DevOps deployments.
01:55
@ErikDarling now that's interesting. I would have thought CT was lighter because it only tracked PK rather than full before & after. What makes CT so burdensome?
We had CDC on our main application DB but removed it because of extra load on the logs was not sustainable.
 
1 hour later…
03:25
Wordle 697 2/6

⬛🟩🟩⬛🟨
🟩🟩🟩🟩🟩
 
3 hours later…
05:57
Morning

Wordle 698 3/6*

🟩⬛⬛⬛⬛
🟩⬛⬛🟨⬛
🟩🟩🟩🟩🟩
 
1 hour later…
07:12
Wordle 698 3/6*

⬛⬛⬛🟩⬛
🟩🟩⬛🟩⬛
🟩🟩🟩🟩🟩
 
4 hours later…
11:27
So, no pressure then.
Wordle 698 5/6*

🟩⬛⬛⬛⬛
🟩🟨⬛🟩⬛
🟩⬛🟩🟩🟩
🟩⬛🟩🟩🟩
🟩🟩🟩🟩🟩
hey! I got it in 5 lol
11:41
@MichaelGreen triggers and side tables at a minimum
11:58
@Forrest Do you and @Zikato work together or are you both having similar issues?
we work together
Totally poached him
and he's regretting that ever since
I'd leave the database in single thread redo, if you're still having issues then note the redo thread OS ID (sys.dm_os_threads with workers with sessions, etc) and then get a wpr for cpu
:D :D :D
nothing wrong with a good poach
mhhhmmm poached eggs with hollandaise sauce
12:02
🤢
FYI I don't work in CSS anymore, so if you opened (or are going to open) a case, I won't see it nor work on it
Also doesn't help that CSS lost over 20 people in the last year
half from layoffs, half from people leaving shitty managers
That's why they opened a case with you directly!
😂😂😂💘
Is there any point in opening a CSS case? I never had a meaningful result. Just "top of the morning to you"
I would say so, but it depends on how fast you need an answer
There's a few (very few) good people left
sadly they have to do the work of everyone
I want the truth! Just give me a few good men
12:11
Especially when some of the issues that come through are things like "our security team wants security updates for our SQL Server 2005 instance for TLS 1.3"
and then hem and haw and bitch and moan for 3-4 months because they don't like the answer of they need to upgrade to supported versions which do support 1.3
I wonder why you don't work in CSS anymore
meanwhile people have real problems, like slow redo or finding bugs in 2022
No problems with log shipping
incorrect
Lots
12:15
Less issues with LS than queries though
I counted them twice to make sure
Although you would have loved last night's conversation
about some type of apply to left semi join something or other transform
and then some weird NoOp thing
@HannahVernon I'm proud!
@Zikato Not for the reasons you think :D
@SeanGallardy Just my sort of convo
@Zikato It was an alignment problem
12:18
Yeah, all sorts of QO output with TFs, turning off rules, it was interesting but I didn't follow much of it
Who was in the conversation?
@PaulWhite I'm chaotic neutral
Certainly chaotic anyway
@PaulWhite Vassilis
2 days ago, by ConcernedOfTunbridgeWells
user image
@SeanGallardy Ah, neat
12:20
I don't want to work on SQL Server anymore when him and Craig and Peter all retire
Peter?
He worked on the engine a ton
I don't think I know him
Anyway, it all sounds much more interesting than EF or DAGs
Most things are more interesting than EF, but not AGs
> my feelings
12:23
AGs just always seem to be the very dull and time-consuming sort of 'interesting'
@JoshDarnell I was referring to the OPENJSON thing
Long IN lists and whatnot
@PaulWhite Yeah, I figured 😁 I was just playing my role of being an EF apologist.
😂🤣
Maybe apologist is too strong of a word.
I know. I just felt the need to explain needlessly
I still want to mess around with those queries to see how they turn out.
12:26
I suppose it's endearing the EF people are exploring ways to pass data to SQL Server that have been well-understood for at least a decade
2
Maybe the EF team is also secretly the MI team?
And there are some neat programmer-specific benefits to using JSON
The next issue will involve discovering parameter sensitivity when all these IN queries get the same plan, based on the first execution
And/or problems with the default cardinality guess for OPENJSON
But hey ho
JSON, much like XML, was a mistake
whatever is in vogue
Literally move fast and break stuff
I see you work on Azure
12:29
It's not a bad choice for receiving or sending multiple rows of data. Just don't do anything with it inside SQL Server
Move fast? Azure? Doesn't compute
3
It feels like it would be hard to quantify the tradeoffs. You're potentially making the query perform worse (by replacing the IN list with that OPENJSON table expression thing). But you're also easing the burden on the plan cache - possibly very significantly. I guess which one you want depends on what problems your specific system has.
@Zikato hahah thank you
Remember when people used XML the same way, and then there were issues passing in 2GB XML parameters?
WhY iS mY sToReD pRoCeDuRe SlOw
@JoshDarnell Yes. There are trade-offs and eliminating the cache pollution problem will likely be seen as a big win by most. There will be other people who experience new problems, or find the new implementation is a lot slower when executed rapidly enough etc etc etc
@SeanGallardy Dumb people deserve to have problems
12:32
@PaulWhite Explains my life then
You're not dumb
Tell that to my problems
I'd like to buy a set of motivation posters by Paul White please
6
I'll pitch in if most are cats
Being dumb is not the only source of problems
@Zikato Shut up and get back to work, you muppet
12:33
is that one of them?
sweet, this one goes on the fridge
user image
5
For anyone who can't use the link
Cool that they have a sense of humour
@Zikato I sense a new line of work
12:42
> Hundreds of years from now, it will not matter what my bank account was, the sort of house I lived in, or the kind of car I drove... But the world may be different because I did something so bafflingly crazy that my ruins become a tourist attraction.
@PaulWhite And given that reality, it would be nice to be able to pick which one you want to do per query, rather than turning the whole thing on or off at the system level with that "UseCompatibilityLevel" method when the DB Context gets configured.
Maybe they'll add that.
Maybe.
There are codebases I've worked on where some IN lists were practically static, or varied in only small ways, so it was okay for them to be string literals. And then some IN lists were dynamic, changed every time, and probably would benefit from the OPENJSON thing.
Maybe I'll leave a comment.
I'm surprised they aren't passing in TVPs
They're apparently difficult because they require a CREATE TYPE
Also table variables don't always produce good plans especially before 2019
12:50
Understandable, it's much easier to create a whole new function to cut up XML and JSON
Realistically, there's heaps SQL Server could do better with parameter-sensitive plans, of which this is a variety
Sounds like someone wants to come out of retirement and work on PSP
the posters are working @Zikato
Intelligent Query Processing made some useful advances, but there's plenty left to do
I remember reading and sort of agreeing with the reasoning for avoiding TVPs somewhere, but now I can't remember all the details. Paul is right that part of the problem was needing a TYPE.
That's specific to the way EF works though. I'm sure they could work that in if they really wanted to
12:53
> Paul is right
Deferred compilation and interleaved execution are useful, but you need to be on a very modern SQL Server. Same with PSP and the various feedback thingies
Having a table/variable/temp table with varying numbers of rows suiting a small number of different plan options is not that unusual, and recompiling isn't always an answer
One can work around these things quite well when all the code is in a stored procedure or other module, but people will use SQL-generating frameworks
It's funny though how often problems due to plans not being reused turn into problems because plans are being reused
@JoshDarnell Do you happen to know if EF can make use of the WITH RESULT SETS option of EXECUTE?
From the point of view of establishing a contract between the code and database, I mean
But this is just my normal preference for assigning tasks where they're best performed I guess
Wordle 698 4/6

⬜⬜⬜⬜🟨
⬜🟩🟩🟨⬜
🟩🟩🟩⬜🟩
🟩🟩🟩🟩🟩
Still beat @H
13:09
how did you and @Zikato got that in the third try?
that was a frigging hard word
My second guess was very helpful
I'm not as good as @J.D.
I've tried to get it on the first try, but then failed twice
My wife had an X on 698
@Zikato but that's not being good, just lucky ;)
Being lucky is quite a useful skill to have
13:23
@Zikato heh my last one was yesterday's word. 🤞 🍀 I can repeat today.
@PaulWhite Curious what you had in mind with this. EF Core does let you drop in raw SQL, if needed, so theoretically anything is possible.
@J.D. Raw SQL ('ad hoc' SQL?) isn't the same as a stored procedure or function though. I was thinking generally about development. If you can execute a module with a guaranteed return shape, a framework could allow you to write code against contracts before the SQL-side coding had been done. Something like that.
Maybe all that goes against the intent of using EF, I don't really know, having never used it
@PaulWhite Well I mean, one could execute a stored procedure in raw SQL using the WITH RESULT SETS clause.
But yea, would be unusual.
Yes. My question was more about what, if anything, EF would do with the information
e.g. match it to some entity or entities within EF without having to do it manually
Word, gotcha. Interesting idea.
13:41
It just bugs me there's so much angst about writing a 'query' in some programming language, then worrying about how the database will interpret the generated result. It might be nice to be able to pass 'entities' to SQL Server via an interface and receive something similar back (if needed).
@PaulWhite is that really harder than CREATE TABLE?
@ErikDarling How would I know. From what I can tell, though, the idea just doesn't fit well with the way EF (currently) works.
But even if it did, you'd still have table variable problems in most cicumstances
maybe table variables need an GENERATE_STATISTICS option
13:43
This reminds me of people wanting down votes for comments
A table variable isn't a temporary table, like a comment isn't an answer
SQL Server really ought to accept (mutable!) tables as parameters
None of this table variable nonsense
yeah i suppose the choice to back tvps with table variables is really the rub
but i don't think that's gonna change
Prolly not
But it would be neat
so maybe when you do CREATE TYPE you should allow for statistics generation there
or they should
13:46
Lipstick meet pig
The hoops people jump through to pass data into SQL Server and get a result set back, it's just silly
hey remember when that guy erland wrote like 50 pages on the topic
Almost as daft as how we have to write dynamic SQL
what year was that
Exactly!
> 2010-01-06
> First version.
13:48
Shocking isn't it
@PaulWhite So forgive me if I'm misunderstanding you. But I just took a quick look at what the devs who use EF here do, and they do execute the procedure in raw SQL, but it's automatically mapped to the type of class the FromSqlRaw() method is called off of. E.g. someDataContext.SomeDataObject.FromSqlRaw("EXEC StoredProcedure @Parameter1", parametersList);. SomeDataObject is a class defined to match the result set shape coming back from StoredProcedure. No WITH RESULT SETS clause used.
@J.D. Right, but that lacks a guarantee.
Indeed.
Compilers seem v happy these days to infer all sorts of things to make life easier.
WITH RESULT SETS would help enforce that from the database side, I suppose, and I think EF wouldn't have a problem if that clause was added in this raw SQL. All the same to it.
13:51
compilers lover interpreting everything as nvarchar(4000)
@ErikDarling Sounds like that guy who wanted to write his own ORM from a few months back...
I'm sure they'd use a JSON type if we provided one 😀
WITH RESULT SETS isn't infallible either, of course, since it relies on the stored procedure actually returning a fitting result set.
@J.D. That's the contract though. The database will throw an error if the db coder buggers it up
@J.D. they all sort of blend into one
13:55
@PaulWhite For sure.
It just seems like both sides could do more to make the db interface more robust and easy to code against
But then I always wanted to be able to create .NET code within SQL Server, so I'm obviously a dreamer
@ErikDarling True. If I recall correctly, they were having performance issues by using the same type for everything, NVARCHAR(4000) or NVARCHAR(MAX) even and refused to accept that that was part of the problem / unwilling to listen to reason to address it.
yep, that's every conversation i've ever had with someone with a homegrown orm
On the other hand, it's arguably silly we have to worry about string lengths in this day and age
but i also just watched my four year old perform "the chicken dance" with her class for some end of year performance and that's stuck in my head
so forgive me if i'm not thinking clearly
@PaulWhite and bigints
13:58
Was that before or after the "egg dance"
2
@ErikDarling Unsupported by many apps, I hear
i mean they're just too big, becky
@J.D. But more to my point, writing EXEC dbo.Proc with parameters is just hard work and error-prone. If you could associate a proc with an entity, you could write much more readable and concise code.
There's other ways to call procedures in EF Core too. That's just what seems commonplace at the shoppe here. I honestly haven't touched EF Core in over a year now, so I'm fuzzy on how to utilize it.
unless someone goes and changes the parameter order on you
Constructors to read one or an array from the db, standard methods to persist objects etc
@ErikDarling Which is why you have contracts
14:02
Back in the day, I recall LINQ2SQL would map procedures to actual methods in your data context. So you can call them just the same as a C# method, syntactically.
Interfaces, whatever terminology works
But I'm sure still lacked the contracts you speak of.
@PaulWhite did you mean invoices?
I do get that some places have almost no SQL ability at all, and EF as-is works for that no doubt
To some extent anyway
Pretty miserable experience for the database engine tho
I suppose the general thought is similar to creating SQL from an execution plan
Like, ok, here's the plan and the SQL you should have written
Tough job in either direction I suppose. But it does irk me it seems like some of the solutions the EF team implement aren't even put in front of someone with actual SQL experience to give their 2 cents on before going live.
14:08
I guess I find it weird so many code-side things use sp_executesql to generate temporary unnamed procedures
@J.D. I see you've never spoken to a DBA :-D
present company excluded, of course
@HannahVernon lol eh?
@J.D. As I see it, some of the problem is there are relatively few people with decent skills in both departments
in my experience they're the most open people in the world
For example, the discussion on that IN list problem (github.com/dotnet/efcore/issues/13617) has plenty of input from developers with some SQL experience
14:11
@PaulWhite Word, perhaps that's a global problem in the industry too. I find it pretty scary the direction software is going. Things should be getting easier, and I feel like they're just getting more complex - at the sake of being new and cool.
Agreed
And, in fairness, passing JSON to a stored procedure (albeit temporary and unnamed) is the kind of solution we've been using for a decade
Because SQL Server doesn't allow you to pass tables into and out of modules nicely
And someone with practical experience would know the potential issues with that solution, and how best to work around them, given the features we do have
The other point about modules being you can change the implementation - and use more than one statement - without breaking the contract with the consumer
I feel like I've had this chat with Darneli before and he told me I was reinventing LINQ
i wonder how jooq does it
So I just discovered by searching
14:21
@PaulWhite That's an interesting thought! EF already has the config data about what types the different properties on an entity map to. So it could totally generate that clause. Extension methods could even be added to provide a projection (if the proc doesn't return all the properties of a given entity.
Feels like there's heaps that could be done
@PaulWhite it seemed like you were engaging erikgpt to answer for you, i do apologize for any duplicative efforts
@ErikDarling I searched in case you had wandered off to issue an invoice or sthg
i am especially proficient at multi-tasking when it comes to invoices
i can send out hundreds at a time
You do love paperwork eh
14:24
paperwork makes the money work
I hear tax time is a bit like giving birth
Painful but soon forgotten
I do apologise if that led to flashbacks
also the ~30 or so days after where you might get a letter saying that they think you owe more money
Ha well the limitation here is like 7 years or something but yeah
i would send them an invoice for my time
equal to the amount of any penalties
I suppose you're talking about the initial response rather than an audit anyway
14:27
checkmate, government
sounds like a flawless plan
yes i would be doing that on an international flight of course
ofc
one way
long haul
destination lacking treaties of some kind
emanuel mexican has left the building
I hear Cuba has nice cigars
14:37
i would repatriate my collection, of course
i think i should do a cost threshold t-shirt to complement the maxdop shirt
14:49
alright, let's record a shitty video
15:20
you did not appear in the video
maybe next time
Was the video about OPENJSON?
no i haven't gotten to that yet
Not sure if Erik knows a JSON
i do want to show some problems with that on tables that have more than 1000 rows in them
which might be an important caveat
15:48
Look at Mr Big Data over here. Having more than 1k rows
The funny thing is that benchmark is probably sufficient for MANY shops using EF. But, it's totally unfair to the folks working with bigger datasets.
At my last job, we had a customer with an app that was 24/7, mission critical for their business, dealt with time-sensitive medical outcomes, and thus needed HA and DR. The biggest table in the database had about 60K rows after being in production for several years.
An ORM worked great for this app, because even bad ORM-generated queries didn't cause all that much trouble for SQL Server when there's that much data, and most all of it sat in RAM all the time.
Which I think speaks against all the people saying EF can only be used on "toy apps and databases." This was a very important app for the customer, and had a lot of complex functionality. Just the nature of the business doesn't generate all that much data.
toy-sized then?
but point taken
@PaulWhite Haha yeah, I guess it depends on what sense you mean toy 😁 But I think most folks mean it to say "you can't us EF for important projects." And I just don't think that's true.
16:07
To play Mr D. Advocate for a moment, if you're using an example where all the data is in memory and the queries don't matter to defend (apologise) for a framework...
Which is to say, any method would be fine, and EF is one of all possible methods
I don't know that that is a particularly strong statement
But then I'm not a programmer so
@PaulWhite I think it's kind of the standard method (not just one of all possible mehtods), for modern devs using .NET Core / C#, generally speaking. Probably based on ease of use and number of features available compared to alternative implementations for those devs.
Don't tell me, tell Mr D. Advocate
But again, it is no doubt standard for people that usually use it
Junior Devil’s advocate
Other people will no doubt use other frameworks or access layers, and point to the same example for validation
Sure there's other ORMs, like Dapper, which arguably trade minor performance improvements at the expense of less features and arguably more dev work to implement. Or going back to frameworks like ADO.NET which again, isn't as user friendly for non-SQL devs.
16:17
Or LINQ to SQL, or home grown, or ...
@PaulWhite Sure, but the majority, which is the modern dev. And the subset using modern .NET frameworks like Core though...
Devil's legal team must be huge
All of these frameworks really serve to illustrate the general gaps in SQL Server development patterns.
@J.D. For the particular people you are talking about, sure. Is that a majority in the world, or just a majority you have encountered? How would we know
@Zikato tbh I think it's just one guy who multitasks extremely well
One can speculate... And of course we're already talking about the subset of the Microsoft stack if we're talking SQL Server, not the world.
16:18
If SQL Server had implemented (or a better implementation of) X then frameworks wouldn’t need to do Y.
@ErikDarling I think that's definitely true in some cases.
Apr 12 at 10:25, by Paul White
All problems can be solved with just one more layer of abstraction/indirection
@J.D. Excuse me, SQL Server is v popular on Linux, just ask Sean
@PaulWhite heh, I'm sure AGs in SQL Server on Linux are just as popular too.
Not to say that ORM developers don’t play muppeteers because they lakh practical database knowledge but you know
16:20
No one uses Availability Groups
I heard AGs in Linux will cause a heart arrhythmia
Even a blind person can play darts
@Zikato Did you have to czech how to spell that
One might think about how many of these 'toy' apps need an actual database
@PaulWhite obviously
I mean, you could storage what Darneli was talking about in a CSV file or spreadsheet
16:22
@PaulWhite It's spelled just like a popular snack food in Czech
@mustaccio Does it cause heart disease
user image
6
today's transcript
All Czech food causes heart diseases
16:24
My point is, I'm not necessarily defending EF Core as the best solution or my favorite even (personally I liked LINQ2SQL ORM more back when I was a noob). But I'm pretty confident it's leading in popularity among modern devs working in the Microsoft stack because it's more robust and easier to pickup vs alternative options within the same stack.
All other things essentially being equal as far as generating crappy queries occassionally.
Yes, but, counterpoint: you are always wrong
@PaulWhite I agree. But now we have a paradox on our hands.
The world is full of them. No one will notice another
@J.D. You should wash your hands more frequently
> Stack of all trades, master of none
16:26
but still better than master of one
There's still a niche for hand-crafted, artisan SQLs
Now witness the firepower of this fully armed and operational SQL query
Don’t be too proud of this technological terror you’ve constructed
I'm afraid the execution plan will be quite operational when your friends arrive
Your overconfidence is your weakness
@Zikato Your feeble skills are no match for the power of the dork SQL
Also, your faith in your friends etc
Everything that has transpired has done so according to my database design
16:50
Let's blow this thing and go home
17:40
I love this room
In other completely unrelated news, I just fixed my $1,000 dryer for under $10.
$10 is what, 3 gallons of gas? Lots of heat.
@HannahVernon nice! What was the issue?
there was no heat.
so, the fix was to get a new thermostat for the heater coil.
$8.45 CDN, plus tax.
Cool...or hot I guess.
@Forrest gallons lol. And $10, lol. In Canada, that's like 4 liters of gas, so 1 gallon.
@J.D. it was cool, now its hot.
17:49
True
I feel like my wife is sad we didn't get to buy a new dryer though.
Last time I ordered a new dryer, it was through Lowes, and it took them literally 3 months to deliver it. They kept re-scheduling and losing track of it's location lol.
Am I having deja vu, or wasn't this closed already today? - dba.stackexchange.com/q/327255/150011
yah, they self-immolated the original after I closed it.
not to worry though, I undeleted the original and closed this as a dupe of it.
so now we have two terrible questions instead of none. But luckily they'll get removed by roomba in the next few days unless the OP fixes the original.
I'm guessing they didn't understand this:
Take a look at minimal reproducible example for details on how to construct your question, then use the edit link below your question to add the relevant details. — Hannah Vernon ♦ 4 hours ago
18:05
Yea, seems a lot of people have a hard time reading.
Thanks for cleaning up again btw.
19:00
@Forrest or @Zikato any new data?
No. Will try to snag some tomorrow.
No U
I still owe @HannahVernon a RCA as well
been busy
me too, Sean, me too
skips
douchebags
I wonder how much of a Bonus Nadella will get from that action
Then, it was leaked to the press that the CFO said "want a pay raise? well then make the stock go higher, that's your pay raise."
2
@HannahVernon In addition to the 55 million? I'm sure he's really slumming it to help out
pretty much - how does he even get by
all while still expecting 10-14 hour days
crazy
how can they run the business with only a 6.7% sales increase /sarcasm
19:07
increase
yah
maddening
i've had a few clients add sales tax to the invoice amount. i wonder why.
really?!
whoa
yeah, free money
19:23
Don't go spending it all on some fancy record player...
Or a dryer
@PaulWhite If I were going to respond to Mr. D's advocate's point (which is fair), I would say that the advantage of EF in a scenario like that (everything is in memory, etc.) is that it's going to be much faster to develop (compared to using ADO.NET and stored procedures, for example).
so, quicker to build that pile of rubble, then?
not that anyone here would ever build a pile of rubble
at least none of the people here who don't use SB
I imagine you're joking, but just to laboriously clarify: my point is that it's not a pile of rubble (despite all of our usual state of default ORM hate haha). It works great in my experience for scenarios like the one I described, and I don't think the scenario is all that uncommon.
yeah, I was just messing about. I don't mean to imply there is anything particularly terrible about using an ORM.
folks are perfectly capable of building terrible things without an ORM :-)
19:36
True!
I have done that as well.
I use Service Broker Borker
Well yeah, that's a problem.
@SeanGallardy Damn, that sucks.
> User does not have permission to query backup files with the virtual table DBLog. Only members of the sysadmin fixed server role has this permission
but I am a member of sysadmin, lol.
this is going to be waaaaay to much fun
also, shouldn't that be "have this permission"
gotta love undocumented and unsupported stuff
@JoshDarnell heh that's what I was trying to say, but thanks for being more succinct.
00:00 - 20:0020:00 - 22:00

« first day (4517 days earlier)      last day (647 days later) »