« first day (2235 days earlier)      last day (2625 days later) » 
00:00 - 23:0023:00 - 00:00

12:58 AM
@MaxVernon You mean from here on your interest just gets less and less?
 
LOL I guess I meant piqued.
 
 
4 hours later…
5:13 AM
@ypercubeᵀᴹ Not a constructive (or accurate) comment. Comments like that are frustrating: they can't be voted on or responded to (within the purpose of comments). Best to just remove it, so I did.
@JoeObbish There might well be 100 different examples though (and/or duplicates). Questions that ask for an unbounded list can be problematic for several reasons, so you'll need to think carefully about what the real question actually is, and how it can be asked within the constraints of Q & A format.
As Martin said, HJ basically comes down to there being an equality. Hash Agg requires a vector (group by) aggregate before 2016. Aside from that, the question of which applications/queries will and won't benefit from (clustered) columnstore is rather broad, and reasonably well documented in various places already.
There is an interesting question there, it just remains to be seen whether it can be made suitable for the site.
FWIW I can't think of any queries that would perform worse, necessarily, with a clustered columnstore than without. That's because CCI adds the possibility of columnstore access and batch mode execution - it doesn't take anything away (aside from a rowstore clustered index, but that can be simulated). There are other downsides to columnar storage of course, not related to querying.
 
 
2 hours later…
7:23 AM
Hey @PaulWhite just a heads up, there's a very suspicious user posting answer linking to a known spam website here and here. I raised a mod flag too.
It popped up on a spam detector bot so thats how I noticed it (We've had at least 18 confirmed instances of that website being used to spam in the past)
 
7:55 AM
@Magisch Thanks.
@Magisch Good ol' Smokey. Nuked.
 
@PaulWhite merci :)
 
 
5 hours later…
1:04 PM
@ypercubeᵀᴹ Just one of those days, huh?
 
@hot2use feels more like a week or month really ;)
 
hi. good evening
I'm in a dilemma. I am working on a result processing software where the result for each semester is used to determine who will get promotion to the next semester. We have a list where only promoted students for a semester should appear. The problem is the calculation for the whole semester result is a bit long process. Should I store the end result in DB or use the calculation whenever I need the promoted students' list?
 
@Anwar IMO I'd store the results in a history table, because one day you might have to prove that the student was allowed to be promoted.
 
@hot2use Thanks. But I can prove from the entries from marks table. The problem was actually large queries. For example, I need to fetch marks for each subjects for a given Term which are also divided by mark types.

I think in that case, history table should be read-only. Right?
 
1:28 PM
@Anwar I was thinking along the line of: A student can be promoted, but then an appeal results in the conclusion that the student should not have been promoted.
 
OK. I got it. The proof will be there. I was concerned about the speed of the query
 
You stored the relevant information in the history table along with what is required to reinforces the descision of the promotion
Depends on how often you will be running the statement.
If you'll be running it once or twice per end-of-semester then you could possibly go without the history table. If you'll be running it more and the results don't change, then you might be better off having a "Run Promotion Schedule" button and storing the data in a table for further reference.
I love this sentence: It depends.
 
The result itself will be needed once or twice... But I need to maintain a student list who got promoted.
And this list will be used more frequently
 
Will the query select all the data or just for a given semester? Will the queried data change? Could somebody modify the data after a promotion list has been created? It's not just about speed. You have to know what your requirements are. Speed can be optimized.
 
1) For a semester only (at least for now). 2) Queried data might change (but normally after the result is published, it shouldn't).
Yes, An admin can modify the data if he wills
 
1:45 PM
@ypercubeᵀᴹ then do something else
 
@dezso quite funny
 
2:42 PM
@PaulWhite what do you mean by simulated?
 
@MaxVernon Perhaps a nonclustered index with lots of include columns?
 
@JoeObbish that was my initial thought. But, with Paul you never know.
 
3:06 PM
Yes that or any index that covers everything needed by the queries that used the clustered index
 
3:24 PM
@PaulWhite The real question is what are some examples of queries against CCIs that require indexes to perform well (other than the obvious ones)? So far my go-to example is string aggregation. I would not ask a question like that here or anyone else, so trying to identify queries with hash join ineligibility seemed like a reasonable way to chip away at the question. It doesn't seem to fit the Q&A format here so I won't ask it. Thanks for your feedback.
 
Hi, can I have your advice? it is not a sql issue, it's about my professional skills.
 
3:41 PM
@McNets Are you asking someone in particular or the room in general?
 
All the room in general
@JoeObbish, all the room
 
I don't see why not? people seem to be helpful and friendly here
 
I am preparing the annual training plan.
Although my current job is IT Manager, I am still working on as a developer in some special projects, which also involves design database.
My company, despite its volume, (~ 250 employees), has no DBA team, and I would like to improve my knowledge of databases.
BI tasks are increasing lately, my first thought was to do an OLAP course , but I believe this is use a sledge-hammer to crack a nut. Maybe something related to db replication and data transformation.
 
3:55 PM
@McNets Technically there isn't a question there. You want to improve your knowledge of databases to accomplish what?
 
@JoeObbish Well that's the question, I'd like to learn about OLAP but I don't really think my company need it.
I know, I must take a decision.
It's in way over my head, and I cant't decide.
 
4:12 PM
@McNets determining what you don't know is difficult because you don't know it (yet). I'd recommend watching an introductory video on a variety of database-related topics, such as OLAP, BI, cloud, etc, so you can get a better idea of what would be an appropriate area for further study.
 
0
Q: Is There Anyway to Fix the Reputation Mechanics on Stack Overflow?

Matthew SontumI have only tried answering questions on Stack Overflow for a few days. But I am troubled by the mechanics of the site. So far I've answered 36 questions. Of those 2 were accepted as the correct answer, 7 have received up-votes but were not accepted as the correct answer, 23 have received no vote...

 
Hi @MaxVernon, yes you're right, It's just I don't know DBA people, and I don't know who to ask and talk about it. And maybe, training companies are offering me more than I need, or worse, something that I don't need.
 
4:56 PM
@McNets Perhaps look at free resources on your own time to get a better idea as to if you should spend company resources on the topic?
 
5:50 PM
Is there a way in SQL Server to add a column NOT NULL but without checking the constraint (WITH NOCHECK)?
 
@ErikE you mean where the existing rows are allowed to be NULL ?
USE tempdb;
CREATE TABLE dbo.TestNull
(
	id INT NULL
);

INSERT INTO dbo.TestNull (id)
VALUES (NULL);

ALTER TABLE dbo.TestNull
WITH NOCHECK
ADD CONSTRAINT CK_TestNull_id
CHECK (id IS NOT NULL) ;
Subsequent inserts with NULL for id fail with:
Msg 547, Level 16, State 0, Line 15
The INSERT statement conflicted with the CHECK constraint "CK_TestNull_id". The conflict occurred in database "tempdb", table "dbo.TestNull", column 'id'.
 
6:05 PM
@ErikE see the answer by Martin Smith:
6
Q: Quickly change NULL column to NOT NULL

Joseph DaigleI have a table with millions of rows and a column that allows NULL values. However no row currently has a NULL value for that column (I can verify this fairly quickly with a query). However when I execute the command ALTER TABLE MyTable ALTER COLUMN MyColumn BIGINT NOT NULL; the query takes fo...

and his comments about possible pitfalls of my solution/answer there. Which is what Max suggested above
 
@MaxVernon Hmmm interesting I hadn't thought of using a CHECK constraint. Thanks!
I'm working in an environment where I have to use RedGate SQL Compare to generate change scripts to schema, and I only get to provide a "pre" script and a "post" script. In changing a column's data type from varchar to int, I ran into an issue where the final state of the column should be NOT NULL, but I need an interim period where it is nullable until I can update the data.
 
0
Q: A fiddle designed for dba.se

Jack DouglasSQLFiddle has been an essential tool and a great complement to dba.se for a very long time, but it has gone downhill a bit in the last year or two. I have also wondered for some time what a 'fiddle' designed specifically with dba.se and markdown in mind might look like, and over the last few day...

 
Do you think my comments on these questions are appropriate?
http://dba.stackexchange.com/questions/164451/source-control-branching-strategy
http://dba.stackexchange.com/questions/164002/best-way-to-migrate-existing-production-database-to-new-physical-storage-structu
http://dba.stackexchange.com/questions/164066/which-sql-server-settings-should-always-be-set
 
@ypercubeᵀᴹ I love having access to Martin's knowledge.
2
 
6:20 PM
@MasterDatabase This is specifically about the person complaining about reputation mechanics
 
@ErikE FYI, @MasterDatabase is a bot
@ErikE all those comments seem respectful, and well thought out, to me.
 
@MaxVernon Ah, thanks.
@MaxVernon Appreciate the feedback.
 
@ErikE That operation is supposedly much faster than it used to be in some cases on SQL Server 2016
in previous versions sometimes modifying a column to be NOT NULL meant that SQL Server modified every data page in the table
 
0
Q: Best practice to do datbase management

user7465645I have an opinion that we should separate db management and thedashboard backend system which processes the data and provides the API. When data model is created during API development we observe that the focus is given on ease of access rather than following correct design pattern. That is one...

 
7:09 PM
The only justified complaint I see in this question is the voting. Yes, there seems to be some lack of voting (up or down) in dba.se. Some people vote a lot and many people vote too few times. But I find it odd that you complain about that, having casted only 8 votes yourself ;) — ypercubeᵀᴹ 35 secs ago
2
@ErikE @MaxVernon ^^^, regarding your discussion about rep mechanics
 
@ypercubeᵀᴹ nice observation!
I love that @AaronBertrand moved that question to Meta Stack Exchange
 
7:36 PM
For fairness, I don't think your answers are all that good either. — Evan Carroll 16 mins ago
One of the rare occasions where Aaron and Evan agreed on something.
 
@ypercubeᵀᴹ that's pushing it, isnt it?
 
@MaxVernon Sadly it's just going to be migrated back because people see "dba.se" and must become police.
 
@AaronBertrand yah. I saw that too... but perhaps it'll last long enough there for some effect.
 
I doubt it. Like his SQL Server knowledge, he doesn't want to hear anyone else's opinions.
I mean, seriously:
I did reply in that thread. Also I'm not using subjective measures. At my last job I was a 10xer before I was forced to become a supervisor. My first month on that job I took a 12K line stored procedure that was timing out and got it down to a 4K line stored procedure that ran in under a minute. I am exceptionally good at getting T-SQL to run more quickly and in less lines of code. — Matthew Sontum 1 min ago
"All praise me because I made a procedure fast once."
 
but he's "Currently the Senior Database Administrator and SQL Developer for Inntopia"
 
7:41 PM
WTF is an Inntopia
 
WHAT CANT THIS MAN DO? BOW BEFORE HIM! HE IS A GOD AMONG US!
 
LOL
Indeed
 
i miss the old days ... internet pissing matches are so much fun!
 
Something tells me he doesn't do well at kids' birthday parties, either. "You think you're a clown? I played a clown in a play once. Let me show how to be a clown, and you will BOW BEFORE ME!"
 
@AaronBertrand you should ask him how he'd split strings
 
7:43 PM
He's doing enough destructive provoking on his own.
 
someone needs to complete his journey to the dark side.
 
"The main reason to generate the execution plan is because it will often suggest missing indexes to you that you can add to improve performance." :/
I don't want to just sit here and attack the guy... but wouldn't you notice other people in the community using execution plans to tune queries?
the whole situation is unbelievable
 
@JoeObbish take it one more step and just blindly accept DTA recommendations
> We are using SQL Server 2014, but the main database is in 2008 compatibility mode, due to a performance issue with one of the stored procedures which occurs in 2012/2014 compatibility mode (In 2014 compatibility the performance problems are consistent, in 2012 compatibility the performance issue only presents itself under load)
 
What is 10xer?
 
@swasheck that I want to see.
 
7:50 PM
54
Q: "A good programmer can be as 10X times more productive than a mediocre one"

m3th0dmanI had read an interview with a great programmer (it is not in English) and in it he said that "a great programmer can be as 10 times as good as a mediocre one" giving reason for why good programmers are very well paid and why programming companies give many facilities for their employees. The ide...

I believe he's referring to that idea
 
a good Sr. DBA would look into the cardinality estimator
 
@JoeObbish clearly he means he's a 10xer while he's not debating people for no reason.
 
@JoeObbish Ah, thanks, I wasn't familiar with the idea. And I think you are right, that's probably what he meant
 
@MaxVernon this guy is the Donald Trump of the StackExchange network
2
 
@swasheck totally false, and by the way you're so mean. ;-)
 
7:53 PM
i believe that "unfair' is the word you're looking for
 
yes, you're right.
I love @BrentO's opening line "I'm going to give you some tough love..."
 
@EvanCarroll You're crossing some serious lines here, bud.
Also, if you have a problem with my moderation, bring it up officially instead of these snide back-handed remarks. You're not 11. — Aaron Bertrand 1 min ago
 
@AaronBertrand agreed. It's super unprofessional what @EvanCarroll just did.
 
@AaronBertrand maybe he is
 
Touche'
Well, I've had enough. If he has a problem with my moderation, he should handle it the right way instead of this petty crying and whining.
 
8:12 PM
I know that I've had direct conversations with the rest of the moderators about the issue with Evan and complaining about mod-abuse on dba.se, so I'll say it here as well. I have recused myself from moderating his questions/answers, because while I've had plenty of open discussion with him and the other mods, he continues to behave like a petulant child who isn't getting his way. As Aaron mentions just above me. So if he really has a dispute, he should take it up with the CM team.
If they believe that I am acting against the best interests of the community, they'll ask me to step down. Trust me, because they've done it in the past for others.
 
ignore this user everywhere
 
yawns
 
@swasheck As a moderator I don't get that privilege ;-) I have to hear everyone fairly
 
this isn't new, with some users
 
@jcolebrand and you're a good person for it.
 
8:17 PM
@swasheck Thanks
 
8:41 PM
@AndriyM I had the same question
0
A: Is there any way to fix reputation mechanics here?

ypercubeᵀᴹBefore going into the question, I'll address two of your comments under the question and answers because I feel they show your thinking: @user you say that you hold yourselves to a higher standard here, and yet, the first question I attempted to answer (because it had a bounty), had a complet...

added mu thoughts.
Feel free to downvote ;)
(yes, the mu is a typo)
 
@ypercubeᵀᴹ ξ
 
@swasheck yeah. And then he ruined it completely with the answer ;)
 
@ypercubeᵀᴹ "answer"
more like, "childish rant"
my 9-year old can carry on better arguments than that
 
@swasheck about non relevant to the question topics. I agree
@swasheck my 9 year old is interested in zombies and vampires
She asked who would win.
 
mine's interested in astronomy (specifically saturn) and singing on stage
 
8:48 PM
Her own answer was that vampires could fly so they could easily escape zombies
 
@ypercubeᵀᴹ what'd you say to that? quality as a parent is on the line here
 
Singing yes, is an interest, too
@swasheck I asked her what would happen if a zombie was bitten by a vampire and vice versa.
 
28 Nights Later
 
Would a vampire be able to escape of zombies with flying abilities?
 
do zombies have actual vampire-nourishing blood? would the vampire need to evolve to keep up?
 
8:50 PM
These all seem nice questions. I wonder if there a SE site for them
 
or Worldbuilding
 
Science Fiction Fantasy sounds like a strip club in Fifth Element.
 
9:06 PM
@Evan I would please ask that if you have legitimate problems with any moderator's moderation, you bring them directly to the CM team. Your less than mature and not very specific allegations of wrongdoing out on the meta sites is not doing anyone any favors.
164
Q: Handling Calls to Remove a Moderator

Robert CartainoStack Exchange has some of the best Moderators around — seriously — and that is due in no small part to the communities who scrutinize and vote in our Moderator elections. We have a rather formal process for electing moderators, but up until now the process for removing a moderator has been quit...

^ please, go there and do this right, or be quiet.
 
@swasheck "on the internet, nobody knows you're a dog"
 
part of me wants to stop ignoring this user everywhere because, hey, everyone likes watching a good trainwreck.
the better part of me realizes that i'm somewhat of a hothead and may get myself into trouble
 
The one that does is apparently the cooler one.
 
@swasheck You can read the discussion room on that meta question:
Lots of fun comments
 
@AndriyM peer pressure is a strong drug, third only to social acceptance and cocaine
@ypercubeᵀᴹ i'm more talking about the evan trainwreck
 
9:15 PM
@swasheck yes, I know. But since you can't watch that ...
 
bah. i ask for netflix and you come at me with bob's streaming service
 
@AaronBertrand excellent. Thank you for the open invitation to put on my white hacker hat and actually do it. I can't give you an exact timeline (because I am very busy and have a limited motivation for spite) but one day you are going to log into DBA Stack Exchange and find you have a reputation of 0. It might not be today, tomorrow, the next day, etc. But sometime within the next year it's going to happen. And I'm still going to deny any involvement :-p — Matthew Sontum 10 mins ago
@swasheck It shows promising signs of evolving into more
 
¯\_(ツ)_/¯
 
@ypercubeᵀᴹ lol.... what an idiot
 
@MaxVernon you don't need to jeagl that
 
9:18 PM
what's jeagl, precious?
 
@swasheck we're not explaining that.
 
@swasheck Oh boy, here we go again.
Jack forbids
 
i'm just proud of the community for not making any jokes about this guy's last name
 
Is this my cue to leave for your, ahem, mature conversation?
 
speaking of @JackDouglas ... howdy
@AaronBertrand i'm not going to go there
just commending the community
 
9:20 PM
@swasheck I'm not going to ask
 
Speaking of Evan, I find it odd how much passive aggression he takes out on moderators in front of a big public audience, but can't respond to a simple message here.
 
It's almost as if he has a different goal.
 
i'm curious about how Inntopia feels about their god-like Sr. DBA/Developer spending so much of their time in an internet pissing match
threatening to hack systems
 
@AaronBertrand you told him to be quiet ;)
 
9:22 PM
@swasheck that's what I was wondering earlier. Seems like he's a "10xer" that spends tons of time not working.
 
@ypercubeᵀᴹ he's never listened to anything I've said before, so...
 
@MaxVernon he doesnt have to. he's a 10xer with with mediocre goals
 
lol
 
we'll just chalk this up to the new hate-group phenomena that are sweeping the US now
 
in Discussion on answer by Brent Ozar: Is there any way to fix reputation mechanics here? on Meta Stack Exchange Chat, 55 mins ago, by Matthew Sontum
10xer means that I produced 10x as much usable code (as measured by the number of objects checked into source control) as the average person in my group (not including me) We also had a ticketing system in which I closed 2.5x as many tickets as the next best person. Note that this was before I got into management. But even with my management duties I was still the top ticket closer and object contributor, just not as far ahead of the next best person.
 
9:26 PM
@MaxVernon I think I've been particularly nice today, especially in chat. You should grep the chan for disparaging claims of 'whining', 'aggression', 'crying', and 'petty'ness. I disagree. I don't like nose diving to those levels though.
 
that explains it. "before I got into management'
@EvanCarroll good for you, Evan.
 
Thanks. Just doing what I can to make this community a more cooperative place. =)
 
Ah, I see. So saying a moderator is a problem and giving vague suggestions they threatened you is cooperative, huh?
Again, if you think I've abused my privileges as moderator simply by standing by another moderator's decision to remove you from a question and suggest that you cool down and move on, by all means, take it to management. If you insist on the vague accusations out in public, I'll take it to management.
 
looks like the @bluefeet signal has been used
 
@swasheck We are giving her some headaches
Do I need to move the comments here to chat as well? Seriously, folks take it to chat if you're going to continue to go back and forth at one another. — bluefeet ♦ 2 mins ago
 
9:32 PM
I'm not sure I understand the problem, @bluefeet - it's meta, exactly where drawn out conversations like this are supposed to happen.
 
@ypercubeᵀᴹ at least we're consistent
eventually
4
 
Who is that Brent anyway? Is he a 10xer?
 
@swasheck uh oh
 
He's at least an 8xer
 
@AaronBertrand discussion yes, but many of these comments have absolutely nothing to do with the post they are under which is just plain noise.
 
9:34 PM
I'm starting to think that anyone who calls themselves "guru" is highly likely to actually be a "douche bag".
 
@MaxVernon that hurts
 
I walked into something I didn't want to walk into
 
@MaxVernon and not an actual guru
 
@bluefeet seems to me to all be about legitimacy and justification of down-voting.
 
@MaxVernon was my nickname at university. Perhaps I was a douche-bag ;)
 
9:34 PM
@ypercubeᵀᴹ ouch - sorry!
 
user image
4
 
@ypercubeᵀᴹ oh, I thought your nickname was douche bag. ;-)
2
 
:35487861 curious. not the word i'd use
 
> migration rejected from meta.dba.stackexchange.com 1 min ago
 
I love this:
I routinely only accept answers. I don't upvote them if I accept them. What's the problem with that? — ErikE 7 mins ago
 
9:38 PM
Does it mean it will come back to our meta?
 
@ypercubeᵀᴹ No I think it is in limbo
Oh, no, looky, it's just on hold now instead of migrated
-1
Q: Is there any way to fix reputation mechanics here?

Matthew SontumI have only tried answering questions here for a few days. But I am troubled by the mechanics of the site. So far I've answered 36 questions. Of those 2 were accepted as the correct answer, 7 have received up-votes but were not accepted as the correct answer, 23 have received no votes and 4 have ...

Anyway if the guy didn't get the message by now that he needs to adjust his expectations...
 
Not locked either. Curious. Perhaps it works differently with meta questions.
 
The whole post looks like whining he didn't get any rep after 3 days
 
@AaronBertrand bickering back and forth about being able to dv someone to zero rep, isn't particularly constructive
 
There is a difference between a correct answer and a good answer, which he would learn after quite a bit more than "a few days"
And if you post 36 answers in a few days I suppose they indeed are correct but not very well documented
 
9:44 PM
Can those in management learn?
 
I just looked at the latest answer, and it deserves zero upvotes
0
A: Backup suddenly is taking too long to complete

Matthew SontumMy experience with backup times is that it is not a linear relationship with backup size. In that there have been many times where I've seen a backup grow only 5% in size, but the time to complete the backup nearly doubled in length. I'm not sure if there are specific thresholds or causes for this.

And I'm not even sure it's correct, 17 years experience don't matter
Neither does "having worked at banks"
 
@TomV some people's egos are so large they can only see themselves.
 
@bluefeet I wasn't suggesting those particular parts were constructive. But they aren't any more or less constructive in a chat room, either. As I said, it's meta, where conversations are always far less constructive than main sites.
 
@MaxVernon Not sure it translates well, but over here we say "that guy's ego is so large they play pool together"
 
@TomV nice
 
9:48 PM
although we call it billiard
 
@TomV billiards is a man's game. Pool is for people who can't shoot billiards.
 
Ah, my long-awaited +2 has arrived. Thank you @ypercubeᵀᴹ :)
 
@swasheck English words that have Greek origin are sometimes confusing, especially when they have gone through a semantic change.
Like empathy and anecdote.
But this was funny!
(anecdote = joke, in Greek)
 
@MaxVernon 3 cushion is ridiculously hard
 
@ypercubeᵀᴹ That's the meaning of the word in Russian, too. I guess it didn't change much since the time it was borrowed.
 
9:51 PM
@MaxVernon what's the difference? I really don't know.
@AndriyM yes, in English it can mean an interesting story, not necessarily funny.
 
@ypercubeᵀᴹ on a billiards table, the pockets (holes) are tiny; just barely bigger than the ball size. on Pool, the pockets are huge man-hole sized things.
 
@MaxVernon OK.
But TomV was saying that they call pool billiards in French.
That "billiards" means pool (or both, I don't know)
 
@ypercubeᵀᴹ No, billiards is a generic term, but we don't play pool, we play 3 cushion or "carambole" mostly, or pin billiards
 
This is an anecdote, not an answer. — Max Vernon 7 mins ago
 
9:53 PM
but 3 cushion is insane
 
@TomV you must be masochistic to play that.
 
you'd like it, it's geometry/mathematics combined with perfect execution
 
@MaxVernon flagged. NAA
@TomV i'd play it like this, geometry/maths, WHIFF
 
@TomV Yes, in tables with no holes.
 
@swasheck You lost it at "perfect execution" :)
 
9:55 PM
i'm a loser, baby
 
@jcolebrand Any chance you'll make it to NTSSUG tonight?
 
@ypercubeᵀᴹ I have a russian billiard upstairs :)
 
Can someone who knows postgres give me a leg up here: sqlfiddle.com/#!15/10f5f/1 as I'm trying to post another answer to dba.stackexchange.com/questions/162688/… ?
I'm trying to do the equivalent of CROSS APPLY from SQL Server in postgres, but... I basically have no experience in postgres.
 
@ErikE what's the problem?
 
@ypercubeᵀᴹ ERROR: syntax error at or near ")" Position: 225
 
9:59 PM
@ErikE you want LATERAL
 
> I basically have no experience in postgres.
 
@ypercubeᵀᴹ I can ask a new question if that's better
@ypercubeᵀᴹ Yes, stumbling about attempt to use LATERAL, INNER JOIN LATERAL
 
this type:
 
@ErikE if it was CROSS APPLY, would it have a joining (WHERE) condition or not?
 
@ErikE You want CROSS JOIN LATERAL
INNER JOIN LATERAL would additionally require a joining condition.
Which you can well provide if you know what it should be, of course
 
10:01 PM
Can you see my deleted answer on that question?
That'll show you the right way to do that.
 
Bar billiards apparently in English
 
@ErikE FULL OUTER JOIN ... my devs tell me i have no idea what i'm talking about when i tell them it's not always the best solution so it's got to be good
 
First, SELECT INTO is deprecated. It's stupid db-specific syntax that should never be used in that context.
 
@ErikE what AndriyM said above. foo CROSS JOIN LATERAL (... or foo, LATERAL (...
 
There is no point in doing a join on a virtual table with a union-all to construct a table. You can just construct the table with the union.
CREATE TABLE foo2 AS
SELECT col1 AS cola, col2 AS colb FROM foo
UNION ALL
SELECT col1, col3 FROM foo;
 
10:03 PM
Oh, darn. I have to go get my kids.
 
@AaronBertrand do you still recommend against MERGE in newer SQL Server builds?
 
@EvanCarroll Don't be a Matthew ;)
 
@swasheck 100%.
They haven't touched it.
 
thanks.
 
@EvanCarroll So you are guaranteeing, 100%, that the LATERAL won't yield a single scan, but will perform exactly the same as the standard UNION ALL with two scans, one per unioned query?
@AndriyM Of course. I don't know why I didn't see it before. It seems so obvious when you say it.
 
10:05 PM
Yes, if the lateral is against a union-virtual table, that'll get evaluated first. There is no point in even using a LATERAL there because lateral is really only useful if there if you're correlating a variable only accessible from outside the virtual table. (afaik).
 
@AaronBertrand this is still a great line
> And Hugo would apparently rather see this (and wait 20 minutes for me to figure out how to write it):
 
@ErikE And I can assure you it wasn't obvious to me at all when I was still acquainting myself with LATERAL. It seemed confusing at first to someone used to the idea that CROSS APPLY was an equivalent of INNER JOIN.
(Yes, INNER JOIN LATERAL was my first port of call too, and I couldn't get it right at first.)
LATERAL is so much more flexible and powerful than APPLY, though. And makes more sense syntactically, too.
 
@ErikE you can get around the addition scan using a SRF =)
That's an interesting question. I can self-ask and answer that.
Maybe others will find that useful.
If you're curious.
 
What is SRF?
 
Set returning functions.
 
10:10 PM
Thanks
 
They allow you to duplicate rows in PostgreSQL if they return a set > 1
this will work: SELECT col1, unnest(ARRAY[col2,col3]) FROM foo;
SELECT col1, x FROM foo CROSS JOIN LATERAL unnest(ARRAY[col2,col3]) AS t(x);
also works.
 
@EvanCarroll That's one aspect of syntax in PostgreSQL that I still find confusing, calling set-returning functions in the SELECT clause, even though they can return more than one row (and more than one column?).
 
SELECT col1, x FROM foo CROSS JOIN LATERAL (VALUES (col1::text),(col2::text)) AS t(x);
That also works.
=) weee, this is fun.
 
If you can't document it with actual evidence, then it is anecdotal, by definition. Please only add answers that can be backed up with reproducible, provable, and factual evidence. — Max Vernon 4 mins ago
 
@EvanCarroll I think that's what Erik had in mind.
 
10:14 PM
@AndriyM never do it, ever. There is really very few cases where it's needed. We do it in PostGIS sometimes, but shy of that it's probably better written as a CROSS JOIN LATERAL
That's an interesting definition of anecdotal.
I think to more correct, the definition needs to be confined to whether anyone can document it with actual evidence. Not just the person making the claim.
 
@AndriyM I don't like that use.
 
It would be bizarre to call evolution anecdotal if a daft person was rambling about it but happened to be correct.
 
I believe it is only anecdotal if it happens on a single database. I've seen this behavior on multiple databases across multiple SQL Server instances. The database grows at a steady rate, but at some points the backup times jump. I would imagine that most DBAs have seen this behavior at some point. — Matthew Sontum 3 mins ago
everybody's got to believe something, i guess
and what kind of Sr. DBA doesnt have a rudimentary understanding of their storage subsystem????
Only the D: Data drive is SSD. Not sure how well I can answer the other questions, I think what I put into the original post is the full extent of my understanding for the physical layout. But let me talk to the IT department, they likely have answers to your questions. — Matthew Sontum 46 mins ago
i call troll
 
@swasheck howdy :)
 
@Forrest wheresat?
Is that gonna be over at the MS campus?
 
10:21 PM
@jcolebrand Yeah
 
@swasheck - just wow.
 
right?
 
He has a lot of useful answers: dba.stackexchange.com/a/164552/110455
 
he's actually right on that one.
 
@EvanCarroll please
You know there is a difference between a correct and a good answer.
That one borders on being an answer
 
10:26 PM
I'm saying on that, a PIVOT would make for a better answer then the other crap on that question.
 
@EvanCarroll I could agree on "would make"
 
Ok, so he lacks effort. Granted. It's still somewhat of a useful contribution in light of being the only contribution that mentions PIVOT.
Let's not make him out to be worthless because he's a bit less nuanced in his trolling than the other experts on this site.
 
When you call everyone else in the world an idiot, the bar goes up for your own contributions.
6
 
@EvanCarroll There is an edit link, anybody can improve the answer ;)
 
heh.
well, there is something to be said for that.
 
10:28 PM
@AndriyM thanks for the suggestion
 
@TomV you kidding me, it's a MS question. The borg would descend and block out the sun. youtu.be/qdDdHMwhU2s
 
Anyway, rejecting feedback from Aaron or Brent is a dumb thing to do
 
Not SARGABLE enough. NEXT.
 
@swasheck Teamwork.
 
"Why do you feel tempdb is a good candidate for an SSD? From what I've read a high number of rewrites is just going to burn out the disk." Everything is a good candidate for SSD these days, get what you can afford with the endurance you need. — Jack Douglas ♦ 15 secs ago
 
10:33 PM
@JackDouglas it all depends on his workload and the rest of his disk layout. it may be good to put tempdb on SSD if he somehow manages to get a substantially high enough read:total op ratio
not likely, but possible
on a decent storage array, you can put tempdb on its own SAN volume and rely on write caching
our Pure SAN smokes our fusionio cards for writes
 
because it never writes them
 
it does ... eventually ... but it sends the write acknowledgement once it's in controller memory (which they still guarantee to persist ... at some point)
 
you can cache writes anywhere, you don't need a SAN for that, just a battery you can trust
 
@JackDouglas hahahahahahahahahahahah. good point.
 
I'm just saying SSD is not going to be slower, and he's worrying about endurance when he really does not need to.
 
10:40 PM
gotcha
 
@swasheck out of curiosity, how much controller memory does it have?
 
2x8GB nvram
 
This is not the right methodology. There is no reason to use SUM(CASE) logic on versions of SQL Server that support PIVOT. SUM(CASE) is what you used to have to do before PIVOT existed. It is extremely inefficient. — Matthew Sontum 6 mins ago
Extremely inefficient?
 
@Forrest I wasn't planning on it, but I could see about it. What time?
 
"We're learning every day" says GitLab. That's really reassuring.
2
 
10:49 PM
@swasheck You forgot to @address your comment at the right person.
 
@AndriyM That's rhetorical, right?
 
@AndriyM gah!!!!! teamwork
 
@JoeObbish Uh, and that one too, I guess :)
 
@JoeObbish nah. it's anecdotal
wait what?
;)
 
I have to admit that I think I'm part of the under-voting problem
2
 
but I have a plan to get better
I'll just upvote all the things that guy claims to be wrong
 
i dont vote on much. i dont answer much, either.
 
The main reason not to allow NULLs is because they degrade database performance and increase the time and space required to save rows (by on bit per row).
And so the trolling begins...
 
@AaronBertrand Wh... what?
 
57
A: Does SQL Server read all of a COALESCE function even if the first argument is not NULL?

Aaron BertrandHow about this one - as reported to me by Itzik Ben-Gan, who was told about it by Jaime Lafargue? DECLARE @i INT = 1; SELECT CASE WHEN @i = 1 THEN 1 ELSE MIN(1/0) END; Result: Msg 8134, Level 16, State 1, Line 2 Divide by zero error encountered. There are trivial workarounds of course, but ...

165
A: Why shouldn't we allow NULLs?

Aaron BertrandI think the question is poorly phrased, as the wording implies that you've already decided NULLs are bad. Perhaps you meant "Should we allow NULLs?" Anyway, here is my take on it: I think NULLs are a good thing. When you start preventing NULLs just because "NULLs are bad" or "NULLs are hard", y...

Seems he's gone to my profile, ordered my answers by vote count, and is going to troll me
 
10:58 PM
if one bit craters your performance profile, you have bigger problems
 
Enterprise performance is the foremost requirement of all vaporware.
 
41 mins ago, by swasheck
i call troll
he has an excuse though ... he's in management
 
00:00 - 23:0023:00 - 00:00

« first day (2235 days earlier)      last day (2625 days later) »