« first day (1519 days earlier)      last day (3647 days later) » 
01:00 - 22:0022:00 - 00:00

22:00
I use global temps only when I've got some sort of multi threaded process where I don't have a permanent table to support it. And usually I have a permanent table to support it.
22:10
Anyone here know why adding DISTINCT would allow the optimizer to rewrite a join as a semi-join?
JNK
JNK
not without seeing the query unless @PaulWhite is here
distinct causes something to change in the result set such that it's fulfilled by the base table and doesnt require results from the joined table?
right
JNK
JNK
He probably knows without looking
POAST THA QUARRY
SELECT DISTINCT p.ProductID
FROM Production.Product AS p
LEFT JOIN Production.TransactionHistory AS th
ON th.ProductID = p.ProductID
WHERE th.ProductId < 10;
JNK
JNK
22:16
well that's a join man
@JNK Probably. It's actually his query. :p
JNK
JNK
that's an implicit inner join
so whoever wrote it needs a rap on the knuckles with a ruler
@JNK Yes, I get why it's rewritten as an inner join. It's the fact that it turns into a semi-join if you add DISTINCT that puzzles me.
@JNK I think it's intentionally bad. It's from a @PaulWhite demo. : )
JNK
JNK
does the order of operations in the plan otherwise change?
Classic @PaulWhite
@JamesLupolt i'm not smart with this stuff
but looking at the query
JNK
JNK
22:19
is there an index supporting p.productID or th.productid?
we're only asking for something from Production.Product ... it's either there, or not in the result set at all
we're checking to see if it exists for TransactionHistory for all occurrences of TransactionHistory.ProductID < 10
so it's essentially an existence check ...
@swasheck yeah i guess just doing the existence check for productid < 10 is more efficient than going through the join
select distinct p.productid from production.productid as p where exists (
select 1 from production.transactionhistory th where p.productid = th.productid and th.productid < 10)
Question from a coworker "what is the name of sql server datatools"
@JamesLupolt the fact that we're filtering on the same thing on the outer table that we're joining on seems to imply exists
@Zane Excel
22:24
I am sad and angry at the same time
"you used some datatools software that I don't have on my machine.
And I'm once again telling someone the same contact they need to make to solve this problem
I've been pointing this person to someone else for a solid 2 days now and she keeps coming back and asking me these basic questions.
@Zane we took a database offline last week after a month of weekly communication and keep getting angry emails saying "WHY IS THIS STILL OFFLINE!!!?? WHAT DO WE NEED TO GET IT ONLINE???!!!!"
i replied to someone with one word:
"literacy"
@JNK Looks like it's the same order of operations, just with nested loops (left semi join) operator instead of nested loops (inner join). And yes, there is an index for both columns.
JNK
JNK
@swasheck yeah this makes sense
the distinct means we don't care how many values are in the other table
right. just that exists
JNK
JNK
the only possible difference in output would be the number of occurences of particular values
22:29
i hadn't thought about this before
about how distinct can imply a logical exists
pretty far out stuff
@swasheck lol
@swasheck Are they looking at some monitoring tool that panics or fails or sends them an email every 5 minutes when a database is offline?
@JamesLupolt no. they're just trying to connect to the DB
@swasheck Cool
It's nice when 'don't do that' is a valid answer, I think
yeah. the level of stupidity here is mind-blowing. we make a crapload of money ... we could make so much more if we just fired the dead weight
22:36
But daddy wouldn't fire the dead weight.
After all, it's his only son
Recently someone asked one of my coworkers "Hey can you ping me the IP address of the FooApp database server? It's named FooDB1"
in soviet russia, server pings you
I'M PINGIN' DA FOO!
i read that in mr. t's voice
ain't got no time to be resolving names for fools
JNK
JNK
22:41
@swasheck It's like that a lot of places
Not many companies follow the advice "Hire slow and fire fast"
A lot of places that grow fast hire lots of people who can't really do their jobs
@JNK firing people takes a lot of money
so does hiring
Then those people get promoted and hire more people who can't do their jobs
JNK
JNK
@swasheck firing doesn't take that much. You can also make it clear someone should leave.
and then not deal with unemployment etc.
Sometimes they even get promoted because they can't do their jobs
JNK
JNK
22:42
Yeah I've dealt with that
@JamesLupolt peter principal
@JNK It definitely happened at RS. "You have no skill at being a sysadmin, but we like you, so we're making you a manager of sysadmins instead."
JNK
JNK
@JamesLupolt Don't tell me that, I'm dealing with some BS at rackspace now
@JNK it does if you're a protected group
JNK
JNK
@swasheck still doable with appropriate performance appraisal history etc etc
I'm just saying if the company is doing their job right (i.e. fairly assessing how folks do their job) it's possible to actually manage this stuff
it's not easy still
and you're right there are political issues
22:48
you can also quarantine people if they're difficult to fire
like giving them a job where no one reports to them and they have no duties that actually matter
@JNK What's RS doing to you?
at 3,027,500 rows, my default sample rate is 15.18%
thought you'd like to know
i'm surprised it's that high
this is with the default settings and no relevant trace flags?
data's pretty narrow. table size is relatively small. tf 2371 is on and db is compat level 12
JNK
JNK
@JamesLupolt telling us we have to have downtime after we were assured for weeks we wouldn't need additional downtime
@JNK Well that's not good. Do they want to do something that really does require downtime?
JNK
JNK
22:53
@JamesLupolt adding a server to a cluster
@JNK yeah that shouldn't require any downtime as far as i know
But it's an unusual scenario there, so my guess is the person telling you that hasn't done it before
One of the more annoying things about working there was that despite all the hardware they own, it was really difficult to get access to a lab environment for testing scenarios like that
JNK
JNK
@JamesLupolt I understand that
but we are a little miffed since for weeks of meetings we were told this would not require an outage
and now they insist we need a 30 minute outage
@JNK yeah that sounds annoying. i have no idea why there would be a 30 minute outage, to be honest. it sounds like a mistake on RS' part
JNK
JNK
they want to run some sort of test, I'm not a sysadmin
JNK
JNK
22:58
sorry you mentioning RS reminded me of it since it just came up this afternoon
Sounds like they're talking about this: technet.microsoft.com/en-gb/library/jj134244.aspx
The bit that requires downtime is the storage tests, but I'm pretty sure you don't have to run those after you've created the cluster already
i need a new thing to learn about to submit as presentations
or maybe a new nuance of statistics
halp
JNK
JNK
@swasheck Highs and Lows of Filtered Indexes
Speaking of filtered indexes:
There's probably some inspiration in there if you haven't already watched that
@JamesLupolt that's the preso that got me all interested in stats in the first place
23:02
Err, that's related to filtered stats though, not filtered indexes
@JamesLupolt exactly
JNK
JNK
@swasheck Parameter sniffing - An analysis of approaches
(recompile, dynsql, etc)
@JNK dbcc freeproccache
next
JNK
JNK
well im done for the night :)
good luck to ye!
me too
23:19
I thought you got into stats because you were a masochist
i love stats
@MikeFal i dont think i have thick enough skin for this
@swasheck You're fine, man. Don't let it bother you. Just delete all those emails
01:00 - 22:0022:00 - 00:00

« first day (1519 days earlier)      last day (3647 days later) »