« first day (2594 days earlier)      last day (2573 days later) » 

00:42
These are terrible release notes: postgresql.org/about/news/1829
@sp_BlitzErik what's wrong with them?
@ypercubeᵀᴹ it's like someone from Microsoft wrote them 😁
Also, congratulations on Macedonia nearly being renamed 🇬🇷
@sp_BlitzErik I haven't read the news. What happened?
"Florida Man's Apple AirPod Started Smoking, Blew Up, He Says"
@SeanGallardy-Microsoft you ok?
@ypercubeᵀᴹ supposedly they're renaming the airport and adding North to their name, hahaha
00:58
@sp_BlitzErik ah ok, thnx
@sp_BlitzErik They may have come to an agreement already, or likely to come.
If they go with a North or Upper Macedonia, I would expect it won't be very easy to sell the compromise to Greeks.
@ypercubeᵀᴹ what do greeks want the name to be?
@sp_BlitzErik the majority? Anything but Macedonia.
The rest don't care much and realize that it would be hard to change now.
my hometown is 20 min from the borders
01:14
@ypercubeᵀᴹ they should call it Atlantis
awesome
No one could deny them entrance to NATO then ;)
 
6 hours later…
07:04
good morning / day / evening
07:51
@MDCCL Oh thanks, that looks really nice
08:03
@sp_BlitzErik We got an answer from a co-author of the Froid project:
3
A: Is support for Parallel Scalar UDF a reasonable feature request?

KarthikAs Paul has rightly mentioned in his answer, there is no fundamental reason why scalar UDFs could not be executed using parallelism. However, apart from the implementation challenges, there is another reason for forcing them to be serial. The Froid paper cited by Paul gives more information about...

@PaulWhite that's very cool!
I thought so
Do you know him well?
 
1 hour later…
09:19
Morning!!
09:48
@sp_BlitzErik Never interacted with him before today. He followed me on the Tweeter.
@sp_BlitzErik In WinDbg:
eb (sqllang!g_featureSwitchesLangSvc+28h) 1
That'll switch Froid on (FAllowTsqlUDFInliningEnabled) on 2017 CU3.
e.g. plan with scalar function: brentozar.com/pastetheplan/?id=H1WpZH2UM
10:11
...
morning
11:03
@Cez Again, sorry, I cannot help you. The OP did not run the query? I cannot say more and not violate the be nice policy. Moving on. — Paparazzi 2 hours ago
Answer only as good as question
@TomV I don't understand this comment, there isn't any cez comment on this answer
11:28
@McNets it's the competing answer
11:45
@McNets @TomV There was a bit of back-and-forth in the comments. Cez deleted his side of the conversation, then added an answer.
@PaulWhite you're a dangerous man 😍
I was just curious and wanted to play around with it. Blame Microsoft for being too mean to provide a preview programme.
Did flip the switch?
Is there a pronoun tax in NYC? (there seems to be a word missing from your message)
Or maybe it's just another pop reference that passed me by
I'm on my phone and have an aspiring five year old database administrator trying to type at the same time
Don't be mean about it!
12:06
@PaulWhite is the deadlock possible with these updates? Seems unlikely. I can't read the deadlock xml. I get that both have an S lock and try to get an IX (which may be my wrong understanding). But is that possible with these UPDATEs, if there isn't any other statements in the transactions?
@ypercubeᵀᴹ I doubt it. Might depend on isolation level, which has been stripped from the deadlock report. My guess is there is a transaction and more stuff we don't know.
@PaulWhite anyway, I understand if you're concerned about another public bit flipping incident
Well I'm not sure I want to make a habit of publishing these things.
Let me know if you try it.
@PaulWhite my debugging prowess is largely composed wishful thinking, unfortunately
12:21
@sp_BlitzErik You have WinDbg though? And symbols?
Yes, and the afternoon to myself
Well all you need do is attach to the SQL Server 2017 CU3 process (F6), run eb sqllang!g_featureSwitchesLangSvc+28h 1 in the Command window, then resume SQL Server (g or F5). You can even Debug Menu->DetachDebuggee at that point).
Ah, okay, I'll give it a shot
Thanks
Was supposed to work on material for Bits, but...
This is much cooler.
12:37
Yeah, I'm looking at that query plan and I can hardly believe my eyes
How trivial is the function?
CREATE OR ALTER FUNCTION dbo.CountHistoryRowsForProduct
    (@ProductID integer)
RETURNS bigint
WITH SCHEMABINDING
AS
BEGIN
    RETURN
    (
        SELECT COUNT_BIG(*)
        FROM Production.TransactionHistory AS TH
        WHERE TH.ProductID = @ProductID
    );
END;
It also works with no data access e.g. simple RETURN @ProductID * 2 for example.
I haven't played around with the specifics very much because the most fun thing was to get Froid going.
Froid as
Did you update your answer on the snapshot question?
I did, but only to add a change to the feature flag offset in CU3
@PaulWhite thanks
@EvanCarroll why is China not coloured in?
12:59
@sp_BlitzErik Doesn't unfold dbo.InitialCap as expected
@PaulWhite ooh. while loop maybe?
@sp_BlitzErik I thought that, but it might even be limited to single statements at the moment.
chump change eh
No doubt the implementation will extend before 2017 R2 releases.
Cool that it works at all.
those udfs must have really been driving up azure bills
the hop-to on this was impressive
13:06
Amazing. We've been telling them scalar functions suck for twenty years, then they see it in Azure and it gets fixed within a year.
For suitably small values of "fixed".
I bet they've enabled the single-statement froid for some Azure trial already.
"dear lord, that australian blogger was right all along"
Greg Low?
they have -- conor left a long comment here
@PaulWhite i was furthering the joke about their detached-ness by erring on your location
@sp_BlitzErik I gave you the benefit of the doubt on that
This would be so useful right now. Can you imagine how many single-line scalar functions there are out there? e.g. stupid date/time stuff
yeh the amount of people i've seen roll their own datediff is astounding
13:14
@sp_BlitzErik Conor's so company :)
curiously he did not respond to our request to be on a query buck
ha ha I bet
So every function here gets awesome-ized: weblogs.sqlteam.com/jeffs/archive/2007/01/02/56079.aspx
oh my word, i want to throw kerosene on that
Except it'll soon be a good practice (!)
I bet SO is full of one-action scalar functions
i wonder if computed column udfs will be given the same red carpet treatment
or if they're considered solved with that tf
at the beginning of my presentations i'm going to start telling everyone that the optimizer's name is paul, and i'm going to refer to it as that rather than keep repeating "the optimizer"
13:32
@sp_BlitzErik Very interesting question. Doesn't work yet. I wonder if they'll think of it.
might be a bit too edgy for now
Sure. I just wonder if the use will occur to them.
I still expect complex UDFs to be a disaster btw
well something has to keep us in business
@ypercubeᵀᴹ would you mind if I add an answer using your comment? I want to show another approach using a function.
13:47
@sp_BlitzErik BTW Karthink just confirmed via DM that the code in CU3 works for single statement functions only.
I reckon Twitter has no NDA :)
hahaha
well that's cool
I mentioned the computed column thing as well
you two are going to be best friends
buddy cop movies and the whole
Not going to happen for V1, so looks like persisted + TF is the go.
@McNets sure, go ahead
13:58
@PaulWhite i haven't run into one yet that couldn't just be replaced with the base syntax
@McNets CHECK (select count(*) from table where standard) = 1 would be an idea - that wouldn't work ;)
Right.
@ypercubeᵀᴹ dbfiddle.uk/…
returns int as if isnumeric(somecol) = 1 then convert(decimal(18,2), somecol) else 0.0 return end
-___________________-
Goodness me. People's capacity to do dumb stuff never ceases to amaze me.
14:00
@McNets does it work? Seems not.
No, you can delete first row
Link to the Q & A @ypercubeᵀᴹ @McNets?
4
Q: Constraint - one boolean row is true, all other rows false

theGtknerdForgive me if I missed it, but I can't find the specific answer to this question. Like the heading says, I have a column: standard BOOLEAN NOT NULL I would like to enforce one row True, and all others False. The are no FK's or anything else depending on this constraint. I know I can accompli...

is ta short for "thanks as"?
14:02
@McNets because CHECK constraints are checked when rows are inserted or updated.
yep
@ypercubeᵀᴹ no other way than a trigger?
People often don't realize that CHECK constraints are row constraints.
What they need is an ASSERTION, and they have not yet been implemented, in any DBMS
4
(except perhaps one or two that claim they have)
@McNets I commented: trigger or restrict access to the table, after you insert the row
And I think the trigger will fail if the table is truncated.
Probably an XY problem
was blogging about merge joins yesterday and had a fun time coming up with queries where an aggregate would be introduced on one side of a many to many join to make it a one to many
@sp_BlitzErik Go on
14:15
@PaulWhite seemed like it was only in cases where columns from one table weren't selected and the goal of the query overall was aggregation
14:26
@sp_BlitzErik How would you ensure the number of rows in the results stayed the same without aggregation?
I mean, introducing an aggregate to get a 1:m join is cool, but we'd still presumably like correct results
Otherwise we'd be using MySQL
@PaulWhite i look at it like join elimination. if you're not selecting a column from one of the tables, the results from the other table won't change if there are dupes or not.
Dupes in the join column(s)?
So you're saying {1} join {1, 1} is no different than {1} join {1}?
Seems to produce different results to me. Two rows vs one.
i'm saying that if my query is select a.col, b.col from a join b using id dupes matter, but if my query is select count from a join b using id then they don't
14:44
@sp_BlitzErik Right, but counting rows means you can use partial aggregation. Take joining a table with two rows each containing the value 1 to itself. To get a count, we can partial agg one table (2 rows), use a 1:m merge join and calculate the result as 2 * 2 = 4 rows, which is correct.
But if you just project from one table without a count, aggregating the two rows into one so we could get a 1:m merge join would mean joining a partial result of 1 row with 2 rows from the other table to get 4 rows of output. Can't do it.
i am by no means arguing, just sharing the plans that i found
Sure. I'm just trying to imagine a (non-agg) scenario where de-duping to get a 1:m join would preserve the query semantics.
If it helps: dbfiddle.uk/…
i totally get that these are different, for instance
SELECT COUNT(*)
FROM dbo.Badges AS b
JOIN dbo.Comments AS c
ON b.UserId = c.UserId
OPTION(MERGE JOIN, RECOMPILE);

WITH Comments AS
(
SELECT DISTINCT c.UserId
FROM dbo.Comments AS c
)
SELECT COUNT(*)
FROM dbo.Badges AS b
JOIN Comments AS c
ON b.UserId = c.UserId
OPTION(MERGE JOIN, RECOMPILE)
jeez louise
Chat formatting can be hard.
@JoeObbish No, send strippers and booze
14:57
Ok sure, but if the CTE had count(*) group by userid, the final query could use sum and get correct results (a regular partial agg). But without an agg, there's no way to preserve the number of rows produced.
@sp_BlitzErik Take a look at my dbfiddle above, and see if you can de-dupe one input and still get four rows output (for the Cannot 1:m query of course)
@PaulWhite yep, the original query that i pasted in here was me toying with counts in the cte
You just enjoy writing demo code for a database I do not have :)
@PaulWhite i'll include a copy when i send you the laptop ;)
(I enjoyed watching you struggle with the formatting btw)
OT but how much punk did you listen to alongside the new wave?
also, the plans i get from your db fiddle locally are both hash joins
unless i left join, then i get nested loops
15:00
@sp_BlitzErik Yeah too few rows and no stats on table variables to get a merge join with partial aggs.
But the simple point is about joining two identical rows in two tables.
@sp_BlitzErik It all sort of overlapped in time. Punk early, then...what...alternative/new wave etc. Also the categories overlap e,g the Damned - punk then alt.
I.e. If you de-dupe one table, it will have one row. You can't join one row to two rows and get four rows.
yeah, same. asking because i got the urge to listen to blitz yesterday for the first time in a while and kinda forgot how they kind of crossed over from straight up punk to very new wave.
Not a band I had come across
Or at least that I recognise now
you might enjoy them. this is about mid transition.
I think I've created more scalar functions tonight than I did in the past 5 years.
well what's been the point over the last five years, really
15:10
@sp_BlitzErik Indeed. Another factor in play is that many of the punk bands simply got better at playing their instruments.
Now writing a script to drop all scalar functions.
@PaulWhite not something you can accuse the dead boys of
BTW in case you were wondering, restarting the instance resets the froid hack.
that's only sensible
memory isn't forever
i think another thing that happened is that people who were much more musically talented got attracted to punk and made it "better" -- the way people who are way too smart for databases like you and @ypercubeᵀᴹ come along and blow everyone else out of the water
@sp_BlitzErik HP uses that new non-volatile main memory :) :)
@SeanGallardy-Microsoft send me some?
:D
15:14
Pssshh, if after I get hit by a truck and my laptop destroyed I can't even get a new laptop - I doubt I can get you memory
@PaulWhite at any rate, if you have spotify or something similar their album 'the killing dream' is peak new wave (and very good) if you're in the mood for something new.
@SeanGallardy-Microsoft man, that's just sad
I about lost it, in more ways than one
life and laptop
yeah, i remember farlee talking about that
15:20
@sp_BlitzErik No spotify but I'm going down a youtube rabbit hole
Couple more layers of distraction and I'll be back to what I should have been doing pre-functions
@PaulWhite drinking?
Here's some meade I'm working on
is that the only thing you can drink?
That and wine, pretty much
Although tequila when I'm feeling amazing
15:25
gotta get that clase azul
are you particular about wine?
@PaulWhite I WONDER WHY
check out joe, coming in hot
caps lock blazing
the tenacity of youth
@SeanGallardy-Microsoft your sorry state needs to stop importing
when will the Florida stripper industry be self sufficient?
never, we always need people with low self esteem and father issues that just need a way to pay for college
@sp_BlitzErik yes
15:27
@JoeObbish you need to read the whole discussion above that comment!
I explained why in the other room
@ypercubeᵀᴹ I was trying to be facetious
I also have planed to create UDFs today
@JoeObbish Why do you hate life?
@JoeObbish answered
@SeanGallardy-Microsoft Joe Sack made me an offer that I couldn't refuse
@sp_BlitzErik No, it's just that I vaguely recall sitting down to work on something about five hours ago, then got distracted by one thing after another.
15:32
apologies if i'm partially to blame
Not at all. I detest being productive
island living
Probably
@JoeObbish I'll have a stern talking to him
@PaulWhite is this what you meant by a sum and group earlier
WITH Comments AS
(
SELECT c.UserId, COUNT(*) AS c_uid
FROM dbo.Comments AS c
GROUP BY c.UserId
)
SELECT SUM(c.c_uid)
FROM dbo.Badges AS b
JOIN Comments AS c
ON b.UserId = c.UserId
OPTION(MERGE JOIN, RECOMPILE)
15:35
@sp_BlitzErik Yes. That's exactly what SQL Server does e.g. sqlskills.com/blogs/conor/local-global-aggregation
you're the best, i don't care what joe says about you
@sp_BlitzErik I hope all of your servers start getting memory waits
@JoeObbish which laptop were you referring to?
Not the VM, clearly
@JoeObbish What sort of offer? A job?
@JoeObbish Playing with the Froid hack discussed earlier.
@sp_BlitzErik all of them
15:41
@sp_BlitzErik ouch, rough day for the Joes
@PaulWhite email sent
man, i was rooting for Joe Obbish - Microsoft
@sp_BlitzErik but then I wouldn't be able to tell you anything anymore
@JoeObbish Enjoy your Collaboration
I swear if you start pinging me on skype...
oh wait, I'm never on skype, nvm
15:45
@JoeObbish you hardly do now ;)
:phew: dodged that bullet
@sp_BlitzErik You're on top form this morning
@SeanGallardy-Microsoft if I worked for MSFT I wouldn't need to ask you questions
@PaulWhite trying to bring something to the table for once
15:46
really though
I'm pretty sure that MSFT doesn't have a job opening for someone who writes weird queries all day
@JoeObbish I'm sure the SharePoint team has openings
ouch
OUCH
otoh, joe does love maxdop 1
I am a room owner and you aren't allowed to talk to me like that
What's up with kids these days?
15:48
Fixed :)
so predictable
@sp_BlitzErik I simply appreciate a nice, clean serial query
though I have spent months which could be summarized as trying to make queries run more in parallel
So glad that still works.
@JoeObbish At least thats what she tells you...
15:52
Has anyone ever seen a good T-SQL query that featured WITH (NOLOCK)?
Adjective: good (comparative better, superlative best)
  1. (of people)
  2. Acting in the interest of what is beneficial; ethical.
  3. 1460-1500, The Towneley Playsː
  4. It is not good to be alone, to walk here in this worthly wone.
  5. 1500?, Evil Tonguesː
  6. If any man would begin his sins to reny, or any good people that frae vice deed rest ain. What so ever he were that to virtue would apply, But an ill tongue will all overthrow...
@PaulWhite yeah
-- don't use WITH (NOLOCK)
I feel that's like asking for good READPAST queries
15:54
Well, ok, by "good" I mean in the context of queries shown in Q & A questions here. When there's WITH (NOLOCK) I always seem to find the query has many other signs of ...er... incomplete understanding.
@SeanGallardy-Microsoft Queue tables?
@PaulWhite Put those as queues in an application, not in my database
@SeanGallardy-Microsoft I tend to agree in general, but I have implemented queues in a database on occasion, and so has Remus. rusanu.com/2010/03/26/using-tables-as-queues
So you don't always snort coke, just sometimes... but if someone else does it, it's ok
@PaulWhite every query issued by relativity uses nolock hints (there's a long history), and they're not too terribly formed, considering
@sp_BlitzErik Relativity?
15:56
florida man accuses others of using drugs
Good job I trust you enough to click on that
well you can see the address
how do you make the inline links?
<---noobs r 'us
put [brackets] around the text and parens around (the link)
just like you do in questions, answers, and comments on the main site
Tiny FAQ link bottom right of the page
tip 'o the hat to you both
on this 4k monitor, it literally is tiny...
i always forget strikethrough
@sp_BlitzErik So they actually hint every table every time rather than setting the isolation level for the session?

« first day (2594 days earlier)      last day (2573 days later) »