« first day (203 days earlier)      last day (486 days later) » 

12:03 AM
> queue_id smallint ID of waiting queue where this query waits for memory grants. NULL if the memory is already granted.
 
ok?
if you want to know the order in which queues are processed I got no clue
they aren't necessarily sharing memory though
you could have max memory % set at the pool level for example
 
yeah, something like that
well without messing with rg
 
how could you even run into a problem like this without rg?
rg is probably going to be the best way to study this behavior if you really want to know
control+F "exciting"
some people are truly passionate about sql server
you able to share anything about the actual problem?
 
a group of small memory queries preventing a large memory query from starting
 
so small they go to the small semaphore?
 
12:17 AM
yessir
 
is the documentation wrong?
it's hard to believe that a bunch of <=5 MB grant queries could block something for a while
or is sql server running on a toaster?
 
looks like queries need 150% of memory grant available?
 
there is a rule like that, yeah
Lonny knows the rule and I can never remember it
but if you do something like kick off 3 queries that take 24% then the fourth one at 24% will wait
 
memory is stupid
 
a query can only take 50% or 67% of memory remaining in the semaphore
 
 
1 hour later…
1:42 AM
new guy appears to have done good work here:
4
A: Precision for average_disk_seconds_per_read?

jadarnel27Extended Events are notorious for being poorly documented. Duration / units is especially so, see: Extended event duration Millisecond or Microsecond? Despite the fact that "seconds" is in the event field name, you're correct that the value being reported is nowhere near seconds. You menti...

 
1:57 AM
Thanks, Joe.
Also, shots fired:
Three suggestions: (1) stop using the deprecated sys.sysprocesses (2) use the ANSI standard <> instead of != (3) stop reinventing the wheel and writing these homemade queries from scratch and having to re-solve the same issues others before you have already solved - go grab Adam Machanic's sp_whoisactive, Brent Ozar Unlimited's First Responder Kit, or Glenn Berry's DMV queries. They're all great but when you're up for big kid monitoring tools, let me know. :-) — Aaron Bertrand ♦ 2 hours ago
 
2:30 AM
no comment
 
Pico seconds? Is it not ticks? Is there a difference?
 
I'd be surprised if any of the Windows or SQL Server instrumentation had reliable picosecond resolution.
So ticks maybe makes more sense.
Although it doesn't explain why the number is so large in a field with "average seconds" in the name haha.
 
Ticks are in a DMV so it ought to be possible to correlate
 
braces for dunking
 
That sort of bug seems more intuitive to me
Just wondering out loud
 
2:36 AM
=)
 
I would check it myself but I'm in a supermarket
 
> not checking SQL Server documentation in the supermarket
 
Well it was on special offer and has therefore sold out
 
Aw, bummer!
You should get pop-tarts instead. They will make you feel better.
Do you have that in New Zealand?
 
just connect to your VM through your phone
 
2:45 AM
sys.dm_os_sys_info has cpu_ticks. Is that what you were thinking of?
 
3:03 AM
@jadarnel27 yes
 
Thanks! I'll take a look to see if those two values track with each other tomorrow. If you haven't before then ;-)
 
user image
3
@JoeObbish beyond my abilities unfortunately
 
@PaulWhite is that legit?
 
@JoeObbish Shop'd
 
on the phone?
very suspicious
 
3:13 AM
But the "New contributor" label is live generally
back home now
 
why am I in red?
 
 
3 hours later…
6:50 AM
@JoeObbish hot dog flair for variety
 
 
2 hours later…
8:36 AM
mundane
 
 
3 hours later…
11:41 AM
@PaulWhite do you still chat amongst us?
 
@sp_BlitzErik I think so!
 
are you aware of any good documentation on resource semaphore queues?
 
nothing springs to mind, no
beyond the basic ones
 
so nothing on how like plan cost and grant size are used to bucket them?
 
@sp_BlitzErik are you talking about compilation gateways or memory grant gateways?
 
11:51 AM
memory grant gateways
 
ok well the basic information I was referring to is in blogs.msdn.microsoft.com/sqlqueryprocessing/2010/02/16/…
> As its name implies, Regular Resource Semaphore is used by all queries under normal condition, while Small Resource Semaphore is used by small size queries (less than 5 MB)
 
yeah, i saw that one
 
@PaulWhite hahaha well done
 
@sp_BlitzErik ok I read back now. Nothing to add.
 
12:07 PM
@PaulWhite publicly? ;)
 
@sp_BlitzErik No, it's not something I know about in detail.
Or have seen answered in detail.
Anywhere.
 
yes, that seems to be the trouble
 
@sp_BlitzErik So, are you really seeing multiple queries destined for the small semaphore blocking the large? It's quite possible there is a slack factor involved, to avoid one type dominating, which would be quite ironic.
Also, have you tried installing more memory
 
12:29 PM
it was the medium queue, i guess. they were around ~300mb memory grants.
all one query
fixed a sort
also lol
0
Q: Does MERGE prevents deadlocks and server blocking?

espresso_coffeeI have started looking in MERGE as an option that I would use in my Application to process transactions INSERT/UPDATE. Seems that a lot of SQL experts are recommending this approach. However, while exploring this method I found some common problems that MERGE can cause. Here is the link from one ...

 
@sp_BlitzErik THERE IS NO MEDIUM QUEUE
REEEEEEEEEEEEEEEE
 
then perhaps a queue within a queue?
 
eeeeeeeeee
 
based on query cost
 
just blow up all of the query costs so nothing qualifies for the small semaphore
hth
 
12:39 PM
@sp_BlitzErik Hey, that's a new contributor you're lol-ing at!
 
2008
not even 2008 R2
 
> Seems that a lot of SQL experts are recommending this approach [citation needed]
 
12:59 PM
 
@jadarnel27 does your company have expertise in vs/ssdt?
 
@sp_BlitzErik Yep. We use those tools for all of our build and deployment needs™
 
can i send someone your way? email me your company crap.
 
Sure! Crap email incoming.
 
1:14 PM
...
 
Haha sent.
 
done
 
Feel free to mock my signature block now.
 
it's not your fault
nuke
 
1:42 PM
@sp_BlitzErik wqaw is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
 
well he did ask about blitz
perhaps i should have
 
2:08 PM
As someone who is so new a new contributor, I should let you all know that I had never heard of compilation / memory grant gateways, and that the discussion and links about them here have been really interesting to me!
 
2:37 PM
 
> faced
 
Haha for those that are especially new.
Hey @PaulWhite - there's a broken image in this blog post. Looks like it used to be in the msdn page you linked to, but the corresponding MS docs page doesn't have any images at all.
Just thought I'd let you know in case you know of some other source for that image.
 
@jadarnel27 yeah I know, I noticed that earlier. I'll fix it at some stage, thanks.
I just need to remember what image it was from eight years ago
 
Oh is that all.
I don't remember anything from eight years ago.
Of course I was quite impaired that year.
So I have a solid excuse.
 
i was there
you had the most fun ever
we were all impressed
 
2:46 PM
\o/
 
> i.msdn.microsoft.com normally uses encryption to protect your information. When Google Chrome tried to connect to i.msdn.microsoft.com this time, the website sent back unusual and incorrect credentials.
 
they're trying to steal your trace flag list
 
@PaulWhite Well you made short work of that!
Next problem up.
 
@jadarnel27 I inspected the page element
 
> web developer detected
 
2:52 PM
Feels a bit that way. Started using it when I was trying to get rid of the new link underlines.
Turned out all I needed was:
GM_addStyle ( `a {text-decoration: none !important;}` );
 
Nicely done.
I use the Chrome inspector to delete gifs when they're posted in chat.
 
@PaulWhite I thought you used jandals for that
@jadarnel27 that's against the room rules
 
Oh? My bad.
Will discontinue illicit use of Chrome dev tools immediately.
 
Fixed the image in the blog post.
 
> SEFIR ++;
 
3:06 PM
@PaulWhite 👋
 
guys making decisions sucks
 
are you sure?
 
YOU DON'T TELL ME
 
3:20 PM
Try rolling a twenty-sided die.
 
eh they're all weighted
 
you
re weighted
 
What are you deciding?
I'm trying to decide whether to use a columnstore index on this OLTP table or not.
 
for
REAL
TIME
ANALYTICS?
 
IMRTAFTW
 
3:35 PM
smh guys
smdh even
 
answer the question, new contributor
 
@jadarnel27 what's to decide? columnstore makes everything better
 
I mean, you had to have come across sys.query_store_query_text in your Well Researched Question®, so I'm assuming there's you're not finding in there, yes? — sp_BlitzErik 35 secs ago
> SEWR--;
 
my snark-o-meter red-lined
 
@JoeObbish Haha yes, real time analytics is part of the reason.
 
3:39 PM
well dress like a pirate and see if i take you seriously
 
well that answers my question about the availability of hard drugs in nyc
 
everyone is on dmt
 
it's the water
some people import new york water
it's very bizarre
 
stop giving away our secrets
 
@JoeObbish must be part of some export deal
or to avoid tariffs
maybe a misunderstanding of what "heavy water" is
 
3:46 PM
how do you all feel about this wording?
/*
We estimate that implementing the
following index could improve query cost (1511.44)
by 60.0274% for 4 executions of the query and 100.963 rebinds of the spool per execution over the last 3 hours.
*/
 
impenetrable
 
@sp_BlitzErik Might be cool to include the "improved query cost" in parens next to the percentage.
 
@PaulWhite in a good way or in a bad way
@jadarnel27 too much math
 
Math is hard.
 
@sp_BlitzErik I don't understand what it is saying at all
 
3:52 PM
We are considering an insert-only approach for this potential columnstore table - so the thing it represents is "immutable" and each time the form is saved, a new copy (row) is created. Helps us track workflow / history among other things. Does that seem like a reasonable use case?
 
@jadarnel27 yes
 
@PaulWhite all of it or a specific part?
 
> for 4 executions of the query and 100.963 rebinds of the spool per execution over the last 3 hours.
 
do all questions automatically start with an upvote now?
 
How does a cost improve over x executions?
 
3:53 PM
@PaulWhite the plan in cache has four executions attributed to it, and the spool in the plan has 100.93 rebinds
 
And how does a number of rebinds change over 3 hours?
 
@PaulWhite Thanks!
 
I'm not trying to be hard work; I just don't get it at all
 
@PaulWhite the cost reduction is an estimate based on removing the operator from the plan by adding the suggested index
@PaulWhite rebinds should be 0 after adding the index
you're not, this is valuable market research
 
ok - how does the 3 hours factor in?
 
3:55 PM
that's how long the plan has been in cache, which most people wanna know
so like if the plan has been in cache for an hour and executed 3000 times that's a lot worse than a week and 100 executions
not worse, sorry, just something to pay more attention to
the background is that i'm parsing apart eager index spools to generate a missing index request that the optimizer won't
 
We estimate that implementing the following index could reduce the estimated query cost (currently 1511.44) by 60.0274%. There were 4 executions of the query over the last 3 hours. Adding the index will eliminate 100.963 spool rebinds per execution.
hate hate hate chat markdown
 
heh yeah
 
wallet-=$0.02
@sp_BlitzErik no
 
I tried to run yesterday. 14 minute mile. Achilles still hurts. Everything is terrible.
 
I walk faster than that
 
4:00 PM
@jadarnel27 That's essentially how Hekaton works.
@JoeObbish I don't think walking while on the bus counts
 
@JoeObbish Aren't you, like, 9 freedom feet tall though?
 
non-metric units detected
@sp_BlitzErik thank you for your help, if you answer explaining why I won't find SHRINK I will accept your answer. — James Jenkins 4 mins ago
Mikael Eriksson did that to me yesterday. Answered over six or so comments. Then added an answer, deleted comments, but left the other side of the conversation. Someone get me my medicine.
 
@PaulWhite i hear it's a non logged operation
 
Every comment costs a gold badge
 
@PaulWhite Oh really? I didn't know that. I've not really read up on how Hekaton works behind the scenes (although I've considered buying Kalen's book on the subject).
 
4:05 PM
@PaulWhite as in he didn't flag them?
 
@JoeObbish right
 
yeah, well
why don't you SAY THAT TO HIS FACE?
I bet you wouldn't
I wouldn't
 
he is an intimidating fellow
Erik knows
 
@MikaelEriksson See above 🙂
Also
@sp_BlitzErik
though it is logged
Hats hold no fear for me
Sadly comment purge does not work site-wide
 
4:13 PM
@PaulWhite SEWR--
 
@JoeObbish surely not
 
Jul 31 at 17:31, by jadarnel27
> Thanks for leaving a comment! Increasing the comment:question ratio improves a site's Stack Exchange Welcomingness Rating (SEWR). A high SEWR assures a site will not be shut down due to unhappy Twitter posts.
 
In any case, we can easily offset any SEWR loss with waves
 
By definition, Joe is correct.
 
That was before we had waves
Nothing more friendly and welcoming than a nice wave
 
4:14 PM
bitmap filters really are the worst
 
wait wait
how does it go
@JoeObbish nuo
 
wait til you encounter a bitmap filter that never accepts an answer
 
@PaulWhite say what now?
 
Aug 19 at 16:07, by Joe Obbish
to be fair, people who don't accept answers are literally the worst
 
@sp_BlitzErik you can't understand my pain
oh
 
4:18 PM
have you tried forcing the bitmap filters on
 
well the issue is bitmap filters wiggle themselves into all kinds of weird places in plans
 
wiggly by design
 
yes
and you can't turn them off!
 
slitheriness is an unintended side-effect
 
USE HINT ('NO_BITMAP_FILERS')
 
4:20 PM
skip to the punchline
 
not to mention how cardinality estimates are displayed in the plan
truly outrageous
 
UX is hard, yo
 
@PaulWhite that's basically it
sometimes the cardinality estimate adjustments caused by bitmap filters cause problems, as you know
personally I only have primitive tools to deal with it
 
so you encounter problems when the estimate is lower than reality, yes?
 
probably memory issues when higher
 
4:23 PM
@PaulWhite aye
will USE PLAN get rid of bitmaps?
maybe I'll just try it
 
should
 
opt_bitmaps?
 
of course it doesn't
they are wiggly, like I said
this is the batch mode bitmap filter
you edit it out of the XML but it just comes back
like a computer virus
oh, like a computer worm
see what I did there?
 
worm worm worm, worm's the form
 
heap just got flagged
 
4:38 PM
Heaps are offensive confirmed.
Or re-confirmed.
 
@PaulWhite not sure if I did good or bad. I try to be a model citizen 😀
Oh I guess half good or half bad. Should have flagged the other comments right?
I feel like this is some kind of citizen test where I’m currently failing badly.
Wait, wait now I I get it.
Nerver comment unless absolutely necessary. That will be my motto.
 
5:02 PM
the problem with not commenting is you don't get credit for it!
 
You don't have to listen to Paul. He can't do anything to you.
 
largely a figurehead
 
he has enough cred on site to start a “downvote all xml stuff” movement and I will loose al my unicorn points.
 
delete and ban the xml tag
 
you missed an xml question yesterday
or the day before
who can tell
2
Q: How to query against exact values in XML column set

mheptinstallI have a table that contains 80+ sparse columns along with a column set column, this is a brief example: DROP TABLE IF EXISTS #ColumnSet GO CREATE TABLE #ColumnSet ( Id INT NOT NULL , Value1 VARCHAR(100) SPARSE NULL , Value2 VARCHAR(100) SPARSE NULL , Value3 ...

 
5:18 PM
Yes, did not see that one. Looks like you got it covered.
 
are you going to pass this year?
 
Sadly not. Company would pay but I’m busy elsewhere this year.
 
what could be more important than pass summit?
all of the great learning and networking
 
Swedish championship for Brass Bands (plays the cornet)
I can hear you fall if the chairs an Google cornet?
 
Congrats, that sounds fun @Mikael.
 
5:24 PM
Yes it is. Kind of like pass but a bunch of brass band players instead.
 
wonder what the code of conduct is like
don't make any jokes about trombones
 
Who knew XML Mike was so multi-talented?
 
user image
3
@JoeObbish not not really ^^
 
@MikaelEriksson way to steal our monetary symbol!
 
 
5 hours later…
10:37 PM
so many query plans
so little time
 
10:50 PM
@PaulWhite Are you willing and able to elaborate a bit more on this quote from your answer?
"The SQL Server query optimizer always finds a serial plan first.
Then, if: Further optimization is justified"
What does justified mean there?
also sry for the comment
 

« first day (203 days earlier)      last day (486 days later) »