« first day (2481 days earlier)      last day (2395 days later) » 

12:59 AM
anyone ever work with the DISABLE_OPTIMIZED_NESTED_LOOP query hint?
 
Just disables nested loop prefetch and the associated memory grant no
 
hmm
maybe I'm being really dumb
one moment
don't get it
that's a weird sort
it seems totally useless, and it's not easy to get rid of
 
Doesn't look very optimized to me
 
USE HINT ('ENABLE_UNOPTIMIZED_NESTED_LOOP')
 
OH GOD YOU'RE WORKING ON THAT QUESTION
 
1:06 AM
IT'S A LEGITIMATE QUESTION
 
Case is the better option, that left join answer is zero bueno. Will just depend on indexes.
Anyway, the weirdest sort injection I ever saw was for a key lookup
 
1:19 AM
how come you don't like it as a question?
query optimizer costs those types of things pretty highly
 
Because the amount of speculation it takes to figure out how 30+ subqueries to as many tables will pan out in different scenarios is absurd
 
oh, I see
I just ignored that part
if you don't like OP's question just answer a different one!
 
Aug 30 at 16:52, by Paul White
BREAKING NEWS: Erik recommends reading the question for increased answer quality
 
other way around in this case
 
1:38 AM
Too bad there's not an easy way to get startup expression predicate filters in there
 
What did you have in mind? Not seeing how that would help
 
1:54 AM
i'm willing to bet that op's indexes are only as good as the initial join, so thinking that a non-join where clause that resulted in sep filters would be an interesting plan choice
may happen if you wrote a case for each possible value in the driver table rather than one long case
 
anyway, i've been awake for quite a while. going to bed.
 
you basically mean getting the plan with the variables without variables
yeah, I don't know how to write that query either
later
 
 
1 hour later…
3:16 AM
@sp_BlitzErik Thanks. In this case it is PII. Write once, read once, delete (all being well!).
 
4:05 AM
@PaulWhite Thanks, much appreciated.
 
@JoeObbish Just an ordinary performance spool, no?
 
4:33 AM
@PaulWhite No. Just too vague.
 
4:53 AM
@PaulWhite thanks for answering and reopening
...and Good Evening
 
@hot2use Was reopened by five regular people, not me.
@hot2use Fair, thanks.
 
5:39 AM
Morning
 
gbn
6:32 AM
Morning all
@PaulWhite This really annoys me. I used to use it quite a lot but now I copy between SSMS and NotePad++ for my own sanity
 
7:04 AM
@PaulWhite I'm sorry. I'm late.
Morning
I have a new phone and I didn't receive SE notifications till now.
 
Evening / Morning
 
7:22 AM
@McNets You're forgiven :)
Morning
wv_party_id is nvarchar(100). Welcome to my world of Dynamics CRM online ;-) This is a data lake with tables coming from Dynamics. The person(s) who designed them should be flogged - in other words your typical COTS app. — Saxman 8 hours ago
Ah, Dynamics
@gbn It seems like an odd bug to have. Hopefully an easy and quick fix now SSMS is regularly updated.
 
gbn
7:37 AM
@PaulWhite One year and one quarter year later...
 
@gbn Well some of that delay will be because Bill submitted it.
It got some extra visibility today in a place that often (not always) produces results.
 
8:08 AM
Anybody any thoughts on this one:
9
Q: Neither DBCC FREEPROCCACHE nor DBCC FREESYSTEMCACHE('SQL Plans') do anything to free CACHESTORE_SQLCP memory

Professional Sounding NameCACHESTORE_SQLCP Sql Plans takes up > 38 GB after a few days. We are already running with "optimize for ad hoc workloads" option on. (Entity Framework and custom reporting creates a lot of ad hocs!) SQL Server 2016 SE 3.00.2164.0.v1 on AWS RDS with multi-AZ mirroring When I run: DBCC FRE...

I gave it my best, but apparently to no avail.
 
8:39 AM
@PaulWhite Sometimes I get paid currency for bringing intelligence to the business. Normally this is an exercise in futility.
 
It might arguably be harder to remove intelligence from the business
4
 
I've never seen a gig where that was a part of the acceptance criteria.
I could try, though.
 
gbn
8:53 AM
Our collective job is "futility for cash"
2
 
9:16 AM
Where was that suggestion when the site name was decided
 
Is it too late to rename it?
 
@gbn +1
 
@AndriyM to meta!
 
9:33 AM
@AndriyM @PaulWhite would that be a bug or a feature?
 
It would certainly be a discussion
 
we have a question in the sql room that you may be able to answer
in SQL on Stack Overflow Chat, 6 mins ago, by Abaddon
is it posible to restore a backup on a database that's currently being replicated?
 
9:49 AM
While I've never worked with replication, the question looks to me so far from contrived that I'm sure it's been discussed many times in various forums, probably on DBA.SE as well.
 
gbn
There are answers here, I found some via Bingling (aye, right, like I used that)
 
10:31 AM
Just came back from the marketing department
I didn't realize we went from industry 2.0 to industry 4.0 in a few years time
 
10:43 AM
3 hours ago, by Paul White
wv_party_id is nvarchar(100). Welcome to my world of Dynamics CRM online ;-) This is a data lake with tables coming from Dynamics. The person(s) who designed them should be flogged - in other words your typical COTS app. — Saxman 8 hours ago
 
CRM, I'm not touching that
 
@sp_BlitzErik did you notice that ^^^ comment? (or was it obvious from the plans when you were writing the answer)
 
gbn
@TomV I have an upgrade of ours in the next week or 2. Some, er, .. interesting queries
And more ASYNC_NETWORK_IO errors than I've ever seen before
 
11:09 AM
@gbn Good luck
 
11:23 AM
@ypercubeᵀᴹ no, but now i'm even more annoyed. hahaha.
all that going on, but 2016 is the problem.
 
@sp_BlitzErik I suggested punishment ;)
The flogging should be extended to whoever wrote or was using the condition where wv_partyid = 343083 without quoting (what should be a) string literal. — ypercubeᵀᴹ 43 mins ago
> ... or posting questions without all the facts
 
heh
ain't that somethin
 
11:51 AM
@TomV There's CRM and Dynamics, where everything is a GUID and your eyes will melt.
 
@ConcernedOfTunbridgeWells Don't remind me, I integrated Dynamics CRM and Dynamics AX data in a datawarehouse some time ago
 
12:27 PM
@PaulWhite yeah, you're right. still useless for this query as far as I can tell
 
1:26 PM
Firefox is crap - when you have 100 tabs open
 
@ypercubeᵀᴹ can't be as bad as Chrome with 100 tabs open
 
@ypercubeᵀᴹ or Edge
 
what's Edge? ;)
 
gbn
Legacy GSM mobile network data standard
 
To be honest I'm not sure if the trouble is the 100 tabs. It could be some memory leak, as I usually have it open for hours / days. It seems to behave after restarting it
 
2:10 PM
@ypercubeᵀᴹ A horrible idea born somewhere in a distant country as a punishment because the EU wanted to separate IE and Windows.
 
Is the only way to set REQUEST_MEMORY_GRANT_TIMEOUT_SEC through resource governor?
 
2:26 PM
2 messages moved to Trash
 
2:52 PM
@hot2use oh, I didn't know that.
So it's related to that decision/judgement that IE should be a removable part of the OS?
 
@sp_BlitzErik around?
 
yeah, what's up
 
Seeing what I would describe as weird behavior on a server, wondering if you've seen it before/have any ideas
have 45 active sessions
only six of them actually got memory grants
12 CPU server, server CPU is around 50%
 
go on
 
keep seeing PAGELATCH_SH waits for the sessions without a memory grant
I'm not a wait stats guy, but is that weird?
it doesn't even have a memory grant yet
server has 60000 MB of memory, every query wants a memory grant of 2662216 KB
 
2:59 PM
why would they need a memory grant for that?
oh boy
are you sure there's no resource semaphore waits on there?
wonder if the waits are because grants are knocking stuff out of cache that queries are trying to read
 
oh
I think I know what happened
serial required memory = 0 KB for all of them
they're actually all running without a memory grant
this is horrible
 
are you running who is active?
 
yeah
for one session
grant_time was 2017-10-20 07:47:30.297
25017 wait time for resource semaphore
 
so they're waiting on getting memory grants
 
but it's only 25017 ms
 
3:04 PM
total or for the query?
 
total for that session
 
so that session has waited 25 seconds on getting a memory grant
 
right, but it's been running for 2 hours
 
do you have any of the blitz scripts installed
interrogation mark
 
no comment
 
3:08 PM
can you install them?
 
not immediately
I think the queries run for hours with a memory grant of 0 KB
that makes the most sense out of anything
 
@JoeObbish regarding your answer in this one
2
Q: Efficient way to handle multiple CASE statements in SELECT

AbhiI run a report in which I have a situation where based on a column value which is basically a Key or Id, I need to fetch corresponding value from the mapping Id table. Something like below: SELECT (case when [column1='A'] then (select value from Table1) when [column1='B'] th...

 
it sounds to me like they're waiting on memory grants -- there may be other waits in there, too
resource semaphore query compile might also show up
 
When you rewrite with LEFT joins, the CASE expression can be rewritten as a COALESCE() of the 30 columns. Maybe you want to add that.
 
@ypercubeᵀᴹ WHO'S BETTER THAN YOU?
 
3:12 PM
Not any efficiency improvement, just slightly more readable
@sp_BlitzErik Pardon?
 
i'm asking a rhetorical question
SELECT *
FROM sys.dm_exec_query_resource_semaphores AS deqrs


SELECT *
FROM sys.dm_exec_query_memory_grants AS deqmg
 
0
Q: Unable to add comments for posted question due to javascript error

SaranI'm able to post any question but sometimes unable to add comments to the answers posted and below error message is displayed on the top of the screen. Database Administrators Stack Exchange requires external JavaScript from another domain, which is blocked or failed to load. I'm using IE 11.0 ...

 
well that's stupid
 
3:30 PM
WE FIGURED IT OUT
 
good weekend. cya
 
@sp_BlitzErik they were running with a 0 KB memory grant
and it was terrible
 
but waiting on resource semaphore?
 
no
at least not for a long time
serial required memory was 0
so they ran very inefficiently without a memory grant (more or less)
@ypercubeᵀᴹ feel free to edit it in
 
3:48 PM
well
this has been vague and confusing as usual
 
you were helpful, thanks
anything that I can clarify in particular?
 
i guess not
 
I'm happy to try to answer any questions...
 
so they should have asked for a memory grant but didn't?
 
@JoeObbish Done
 
4:20 PM
@sp_BlitzErik They all had a desired memory grant of 2.6 GB but a required memory grant of 0 KB
there were too many of them running at once so some of them ran with a memory grant of 0 KB
the lucky ones got a memory grant of 2.6 GB
@ypercubeᵀᴹ thanks!
 
were there any forced grants?
 
do you mean with RG or hints?
 
neither
SELECT *
FROM sys.dm_exec_query_resource_semaphores AS deqrs
there's a column called forced grant count that'll tell you if sql is stealing memory to give to queries
 
4:46 PM
interesting
never used that dmv
 
 
4 hours later…
9:14 PM
1 message moved to Trash
 
10:07 PM
@PaulWhite @sp_BlitzErik (or anyone else): Anyone have a demo for a SELECT query with a high (250 KB+) value for serial required memory?
 
@JoeObbish lemme dig around, running through a deck atm
how soon do you need something?
 
thanks
not urgent
Wednesday or so?
 
word
 
10:52 PM
also I'm actually looking for 250000 KB+
 
11:26 PM
@JackDouglas you deleted my ultra cool image.
=(
 

« first day (2481 days earlier)      last day (2395 days later) »