« first day (1294 days earlier)      last day (3575 days later) » 

8:18 AM
Good for dba.se? I don't know why the question has a downvote. Seems legit.
0
Q: Query logic check: to calcualte no. of primary keys in db

variableResults of 1,2 and 3 below are same. Just need to know whether this logic is correct that both of the queries return the value of no. of primary keys.. 1. SELECT * FROM sys.indexes i INNER JOIN sys.tables t ON i.object_id = t.object_id AND t.type = 'U' LEFT JOIN sys.extended_properties AS EP ...

 
8:36 AM
I'm not sure we want RTFM questions?
 
9:30 AM
@ypercube too basic
 
9:41 AM
ok
 
10:21 AM
From [jwz.org:](http://www.jwz.org/blog/)
*'Kenobi prefers the obliging company of droids which, long story, accounts in part for the Cantina's policy against them.'*
 
 
2 hours later…
12:40 PM
@ypercube Are you around?
it's partly down to personal preference and exactly where the school is of course but the bits above are the places I'd recommend
If you want lots of 'stuff', West Norwood or the 'triangle' right next to Crystal Palace Park
If you want quieter/more suburban, off Beulah Hill might suit you
 
12:57 PM
@JackDouglas I'm here.
 
any of that useful?
 
@JackDouglas Yes, thank you.
The school is just below of the "Bellulal Hill"
 
Bellulal?
or Beulah?
 
Right. Beulah
At the dot.
@JackDouglas Do I understand right that I should prefer the encircled areas?
 
1:12 PM
@ypercube My flatmate is an estate agent manager. Current branch is Kingston but prior to that she was in Tooting Broadway, so she'll know a bit about surrounding areas. What would you like me to ask her?
 
@MarkStorey-Smith I don't know. Maybe if there areas to avoid?
I'll try to find something close enough to the school so we can walk. For this year.
I suppose we'll have a better image when we have lived there for a while.
 
Whats the name of the school?
 
St. Cyprian's Primary Academy
 
I'll ping her an email
 
Thnx (to both)
 
1:28 PM
@ypercube yes
very broadly speaking
 
 
2 hours later…
3:05 PM
@PaulWhite @Lamak Can I has some rep too?
 
@Kermit no
 
i'm le sad
 
you already have le 23k
so there isn't any le point giving you more
 
but i want 24k
 
sit on your hands for a few months and you'll find you've got 24k?
 
3:10 PM
my hands will fall off from cut off circulation
 
You see the rate FreshKermit downvotes? If he sat on his hands for a few months, he'd be at zero
 
my downvote rate is fairly average
 
Fine, ruin my joke
 
ha ha 1500 up 4000 down
 
i would have downvoted your joke
 
3:12 PM
i dont think it's a joke
 
where can we see your votes received?
@Kermit do you need hands?
 
@JackDouglas valid point
 
@billinkc Wouldn't he be upvoting, if standing on head?
 
At which point my kilt flies up and nobody wants to see that...
 
@billinkc i'd upvote that
 
3:19 PM
@Kermit wait. that'd be a downvote since you're already upside down, right? i'm so confused.
 
when did i get flipped on my head
 
3:34 PM
Iran Air Flight 655 was an Iran Air civilian passenger flight from Tehran to Dubai that was shot down by the United States Navy guided missile cruiser USS Vincennes on 3 July 1988. The attack took place in Iranian airspace, over Iran's territorial waters in the Persian Gulf, and on the flight's usual flight path. The aircraft, an Airbus A300 B2-203, was destroyed by SM-2MR surface-to-air missiles fired from the Vincennes. All 290 on board, including 66 children and 16 crew, died. This attack ranks seventh among the deadliest disasters in aviation history, tenth if including the 9/11 attacks, which...
TIL the US shot down a commercial aircraft
 
JNK
yeah a while back
 
In the history of commercial aviation, there have been many airliner shootdown incidents which have been caused intentionally or by accident. This is a chronologically ordered list meant to document instances where airliners have been brought down by gunfire or missile attacks, including wartime incidents, rather than terrorist bombings or sabotage. == 1940s == === Kaleva OH-ALL === Junkers Ju 52-3/mge "Kaleva" OH-ALL was a civilian transport and passenger plane operated by the Finnish carrier Aero O/Y, shot down by two Soviet Ilyushin DB-3 bombers on June 14, 1940, while en route from Tallinn,...
 
I do realize that the spirit of what I am trying to do could be in violation of the terms. I'll have to do some more research into the terms before I role this out. Otherwise, I do have another software I could use for the data integration portion of my project. — Andrew Corson 2 mins ago
I think I'll keep striking these two matches together while showering in gasoline. I'm sure nothing bad will happen
2
 
JNK
3:51 PM
@billinkc More like "I'll just keep taking all these free boxes I find on people's doorsteps. How am I supposed to know they aren't for me and/or I should pay for them?"
 
Trooth
 
JNK
It's all just free stuff that nobody worked for thousands of hours to produce!
Tell me if this is too snarky
@user44098 I've always heard and practiced the opposite - the table is a collection of "Users" where each row is a "User". There's a reason that in the object explorer tree it says "Databases" not "Database" and "Stored Procedures" not "Stored Procedure". As well, not to be too trite, it's a little jarring to be lectured about proper English usage in a comment with a misuse of "there". — JNK ♦ 14 secs ago
 
Can you ever have too much snark?
 
@billinkc he has them saved in a Snarks table.
4
 
JNK
4:11 PM
Yeah Kermit is the owner
 
I have to give an internal presentation about parameter sniffing/execution plans... Might this be my foray into presenting?
3
probably not
 
@bluefeet boo. flagged
 
@bluefeet most likely yes :).
 
I hate public speaking
 
well i (by and large) hate the public
 
4:20 PM
@bluefeet who doesn't? there's even a word for it, Glossophobia
@swasheck you're a smart arse :)
 
better than being a dumb one
 
@bluefeet Get a buddy sirsql.net/blog/2014/7/16/…
 
@billinkc won't make it any easier. Plus I'm an introvert who doesn't like people
:)
 
But there are plenty like that in the community. Still can rock out presentations once you get into the zone
 
5:04 PM
@bluefeet I had the same fear once.
Just think of the audience as guys who ask questions at SO. You're their mod ;)
 
@ypercube but in the real world, you can't really mod-hammer someone, can you?!
 
@MaxVernon not if I want to keep my job
@ypercube good point
 
I should say that you'll be the answerer of the question (about sniffing). Mod experience should help though.
 
5:24 PM
@bluefeet That's exactly how I got into it. I hated the idea of presenting to co-workers, tried everything to get out of it. Funny how things turn out.
 
Who are you again?
 
@PaulWhite I hate giving presentations but we have a user story to create one for this topic. No one else has grabbed it so I figured, why not
 
@bluefeet hire @PaulWhite to present for you
 
$5
 
@bluefeet i hear the going rate is 350 SO rep
 
5:36 PM
@Kermit I can't afford to fly him to Arizona
 
@bluefeet you can trade rep for miles.. 10000 rep = 10000 miles
 
Wait, you're punishing paul twice over? Making him go to AZ and then subjecting him to more SO nonsense? Why the hate?
5
 
 
2 hours later…
7:19 PM
can I pick the brains of the sql server folks in here?
 
@user44098 That is bizarre logic indeed. A table is a set of things. A set of users, a set of packages, a set of messages. It is not a set of user, a set of package, or a set of message. You update all the users, you don't update all the user. I think the singular nomenclature comes from object-oriented people who are always thinking of things as acting on a single item at a time, which is not how we think in SQL Server. — Aaron Bertrand ♦ 22 secs ago
 
@bluefeet pick away
 
JNK
@AaronBertrand yep!
 
We've got a proc that is used for an SSRS report - we are having some parameter sniffing issues with it. Basically this goes through and runs 20 or so queries to get the final result. Based on the parameter we can have 200 rows up to 400k+ rows returned.
 
JNK
@bluefeet is there a date param?
 
7:25 PM
I've compared the execution plans for each of the separate queries to see what could be helped by the OPTION RECOMPILE and it is most of the statements but adding this could kill the CPUs if we have multiple people trying to run this report at the same time, correct?
 
JNK
this is a classic issue
 
@JNK not a date range - it is a straight date - 20140701 - the issue comes with the other parameter
We've got 2 a date and an ID
 
JNK
@bluefeet no but date params on reports are notorious for param sniffing issues
 
Even if it isn't stored as a date - it's an int?
 
JNK
is it changed to a date for comparisons?
 
7:27 PM
@bluefeet did you try the typical declaration of new parameters inside the sp?
 
@bluefeet I doubt it, if you run the queries in Plan Explorer with option (recompile) what percentage of time is spent on compilation?
 
@JNK no
 
@bluefeet how complex is the plan? what's the sql server version?
 
@Lamak I didn't try that one yet
 
JNK
@bluefeet yeah thats a good test
 
7:27 PM
@AaronBertrand @bluefeet exactly. if plan compilations from a few procs are killing CPU then you have bigger issues
 
JNK
@Lamak pointed me to that one on my issue when it came up with SSRS a year or so back
 
@swasheck sql server 2012 - the plan is complex for each of the 20 queries in the proc
 
@JNK oh, right, still using the same hacks :-/
 
lexmark is a hellagood resource
2
 
@AaronBertrand let me try
 
JNK
7:28 PM
@swasheck +100000000000000000000
 
I just know some quick fixes, not how to really solve the issue
 
@AaronBertrand what are your thoughts on OPTIMIZE FOR UNKNOWN
 
9
Q: Plural vs Singular Table Name

John Isaiah CarmonaHow should I name my Tables when creating a new database? Singular: Client or Plural: Clients?

I knew we must have one of those here
 
7:56 PM
@AaronBertrand a fraction of a second for the compile time
 
JNK
8:08 PM
Dear twitter app, I give 0 f's if three random people I follow are talking about True Blood
 
But, but it's true blood. Better than that vegan friendly stuff
 
was it something i said?
@bluefeet recompile won't be killing you, then
@bluefeet have you explored OPTIMIZE FOR?
 
@swasheck I checked out OPTIMIZE FOR UNKNOWN still get a crappy execution plan for the ID that return a lot of data
 
@bluefeet do you get a better plan if it's hard-coded?
 
JNK
@bluefeet just do with recompile
if it's a single query in the SP giving you issues use OPTION (RECOMPILE) on the query
 
8:16 PM
@bluefeet @JNK ... does OPTION (RECOMPILE) get you a good plan, though?
 
JNK
if it doesn't its a stats issue
 
@JNK if I do the whole proc, then we lose stats
 
JNK
or cardinality
@bluefeet if its just one query use OPTION....
 
@JNK yeah ... that's where i'm moving toward
 
@JNK it's not one query, it is most of the queries in this proc
 
JNK
8:17 PM
oh lord
 
@bluefeet can you run it with that recompile and see if you get a better plan? maybe just get the estimated plan (based on stats) to see if you get a better/different plan
 
JNK
are you sure your stats are ok
and what do you mean "lose stats"?
are you checking the plan cache for stuff?
Ty Cobb just came on and I thought of @swasheck
 
;)
HARD-HEADED ____ YOU ALL
 
JNK
yeah
also how sure are you it's the exec plan?
Exec plan numbers are not to be trusted!
 
@JNK with recompile means no execution plans in cache to review, etc
 
JNK
8:21 PM
@bluefeet yeah which is fine, isn't it?
 
esp if it works better
 
JNK
do you regularly review exec plans in cache?
My thing about exec plans above is all the numbers are based on estimates
and the estimates are super crappy for certain things
i.e. scalar functions, nested views, etc
The only reliable way I've ever been able to get actual runtimes for sections in a long SP is to add debug code to output MS for each section
 
@JNK testing now :)
 
JNK
if that's not getting it I would look into stats
stuff like filtered indexes can screw you up too
or very large tables
I had an issue with a huge table that we added tons of data to not updating
we added 25m rows to a 1b row table monthly
stats updated once a year at the 20% auto-threshold
 
@JNK there's a trace flag for that
 
8:31 PM
Talk to your DBA about whether trace flags are right for you
3
 
JNK
If you have an open transaction lasting more than 4 hours, consult a specialist.
 
Area 51 wouldn't allow me to use the tag 'music' for a suggestion in music. And its a stipulation at the end of my effort here at stack exchange. Is this a bug?
 
wut?
 
Almost as buggy as that question being posed to a bunch of database nerds ;)
 
talk nerdy to me
 
8:35 PM
Read Dirty to Me - Isolation Levels/User Impact sqlsaturday.com/viewsession.aspx?sat=300&sessionid=23583
 
@bluefeet have you been able to identify the statements within the batch/proc that are performing poorly?
 
@swasheck Yes, I've already done lots of improvements to this proc. Added some indexes that were missing. But I ran across this parameter sniffing issue today
 
ok. good.
 
@bluefeet well, I still think that reassigning parameters should help
 
Furthermore, I think Carthage should be destroyed
 
8:44 PM
lol ok ok I found a better spot to post that
 
8:55 PM
My shakey hands will be the death of me.
 
Only if you change careers to ordinance disposal
4
 
9:09 PM
-4
Q: Save me from this SQL hell

Chris V.First off, let me try to provide some context. I'm developing an app that is used to check which tests have been requested, which test results have been received, and which results are extra. These are basically groundwater tests. Each "Sample" has many "Analytes"; an "Analyte" is just one test t...

NO!
 
odd ... i thought an "analyte" was something to be analyzed and an "assay" was the test. — swasheck 1 min ago
lol
 

« first day (1294 days earlier)      last day (3575 days later) »