« first day (1515 days earlier)   

1:34 AM
user image
7 hours later…
8:27 AM
8:49 AM
@Lamak thanks but I have to disagree - the general level on meanness on DBA is much lower than the SE average :)
even the SE average if you strip out SF, which makes quite a difference ;)
9:11 AM
@JackDouglas Great! We can start being meaner then ;)
10:03 AM
@JackDouglas SF is very mean compared to the rest of SE? (I'm registered there but visit it very rarely.)
10:20 AM
What do you think about moving this over here?
Q: SQL Server 2014 temp variable update performance

Ben GawiserOkay, so I have a query that looks like this: Declare @Table1 Table (some columns) Insert into @Table1 [QueryA] Update @Table1 set Field1 = A.Value1 from ([QueryB]) A where Field2 = A.Value2 Select * from @Table1 QueryA is a simple query that returns ~150 rows. QueryB is more complex and ...

The SE average is not something we want to aim for :)
I guess it's either we aim for it or we drag it to our level.
@AndriyM Not that interested, it's fairly basic.
The first SO answer is predictably awful though.
It made no sense to me, even though I myself have little to say on the matter.
It's barely English.
11:22 AM
@PaulWhite I thought we were speaking SQL here
@AndriyM I think it does have a bit of a reputation
I find the site really useful though - you have to have a bit of a thick skin
12:18 PM
The thing I didn't like about SF is that it has a tendency to argument by assertion
DBA.se is pretty good about providing evidence and explanations
In the comment thread under the question some of them do link the unwelcoming behaviour with frustration about deteriorating average quality of new questions – something we've been experiencing too.
We need to get better at closing/deleting hopeless questions quickly. And placing otherwise duff ones on hold quickly. And reopening improved, previously-duff questions. The system does work, mostly, eventually.
21 hours ago, by Aaron Bertrand
user image
1:20 PM
morning folks
1:36 PM
1:51 PM
2:03 PM
Shameless plug:
nice reading from @AaronBertrand on NOLOCK with #Temp tables
tl;dr version - don't bother
But for faster!
@MikeFal Aren't you on a plane?
Nope, in the airport. DIA
Flight boards in about 20
2:27 PM
@paul thank you for the edit. Once I saw all the _dta_ stats I felt compelled to be brief.
I wouldn't bother but there are 6 upvotes on the accepted answer, which was posted long enough after the last edit or comment from the OP too, so...
What do you mean by row 0 and row COUNT(*)? First and last row when sorted by val? In your example, two rows have the min val (which is 1), it's the rows id=1 and id=4. Your expected output shows that of the two only id=1 was removed. Why not id=4? And must it really be one row and not both? I'm asking this because the answer you've accepted would remove both val=1 rows from your example data. What was the actual requirement? — Andriy M 3 mins ago
2:42 PM
Watch out DBAs, I'm walking into a whole new world of writing potentially bad SQL. My next project is using Impala (Cloudera SQL on Hadoop) to write queries for Tableau reports.
This is the first time in at least 4 years that I am not using SQL Server for an entire project.
You never really used it in the first place
/me ducks
@AaronBertrand Yep. I dislike long comment threads so I moved the outcome to your answer and removed my side of the history. Works ok I think.
tl;dr y. np.
3:27 PM
@mmarie all of these drag-and-drop automagic sql generating reporting tools create some truly awful sql. impala isnt special
@swasheck I don't think I'm dragging and dropping, but agree that there are several tools like that. But the flavor of SQL is slightly different and I wasn't really that good at writing efficient SQL in the first place compared to you guys. So it will be a fun learning adventure.
3:47 PM
please, please, reopen this (only one vote is missing)
You have changed your question completely... However, a record could take all the values you select in the query. — dezso 2 days ago
@MikaelEriksson Ha!!!
You agree right ;)'
"To all you mods and high reps" < Classic.
This actually reminds me of a question of my own that I have thought about a bit.
is it possible to do a group by cast(DateTime as date) and avoid a sort
Does not look like it can use an index on datetime column
thanks, whoever it was
3:54 PM
@MikaelEriksson Did you GIVE IT A TRY!?
Yep but it was a while ago.
declare @T table
  D datetime primary key

select count(*)
from @T
group by cast(D as date)
you're missing FOR XML AUTO
Moving rows to another table does the job without sort but...
declare @T table
  D datetime primary key

declare @T2 table
  D date primary key

insert into @T2(D)
select cast(D as date)
from @T

select count(*)
from @T2
group by D
group by D? ...
shouldn't that be in the insert query?
@MikaelEriksson BTW I wouldn't be surprised if the source data did not in fact include a time component.
4:02 PM
@ypercube Nope, then I would have the sort in the insert query.
@JNK 's dba would also put an ORDER BY on the insert query
@MikaelEriksson But how do you insert, when T2 (D) is the PK?
@ypercube Oh, yes bad example. non clustered index T2.D should demonstrate the same just fine,
or clustered for that matter, just not unique
declare @T2 table
  D date index IX_D clustered
@swasheck oh does
a heap's just a FIFO buffer, right?
this was an interesting read, but the conclusion was quite abrupt
4:11 PM
Can't read, that layout is too obnoxious
yeah. the layout was very obnoxious
"Aral" seems like one of those words that's just asking for a kerning joke
i'm not sure we let this one stand, folks
Q: Why disabling adding SQL Server user to "Perform volume maintenance tasks" improves database resizing so much?

Nikolay KostovIf I want to create 5GB database with CREATE DATABASE [test] CONTAINMENT = NONE ON PRIMARY ( NAME = N'test', FILENAME = N'E:\2012\test.mdf' , SIZE = 5529600KB , FILEGROWTH = 1024KB ) LOG ON ( NAME = N'test_log', FILENAME = N'E:\2012\test_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%) it ta...

@swasheck yeah, I've seen plenty of those annoying things lately
IMO, this is a terrible solution
A: SQL Server 2012 Pivot

jpwYou can not use dynamic sql in views or function. One possible solution could be to alter your query to drop/create a view and use it as a stored procedure that gets called by a trigger on insert/delete in the source table (so that the view is updated whenever rows are inserted or deleted). The ...

4:17 PM
@swasheck I think they're FINO in SQL Server (First In Never Out)
@JamesLupolt That's Mango DB
@JNK that's FI? ... "First In ? after that because we dont know if the write succeeded and besides, we're solving write speed problems, not read"
FINS - First In Not Sure
@JNK I don't know if the vertical alignment problems belong to kerning but the typeface looks ugly
@JNK i'll drink to that
4:23 PM
You also say "SELECT TOP 1000 * FROM table_with_1m_rows ORDER BY col1; ORDER BY will perform even worse, because it will have to first arrange all 1m rows in the table before it then returns 1000 rows. All of the above holds true whether the DB needs to use a sequential scan or an index scan.." Really? Will such a query always have to sort all the 1m rows of the table? — ypercube 2 mins ago
Please, someone tell me I'm crazy. I can't understand this guy's assertions in the question.
Ohhh lord. I need to quit drinking.
@Zane maybe you just need to drink better stuff
It was good stuff I just had to much of it.
what was it
@AaronBertrand would you take $25 + S&H?
4:39 PM
@PaulWhite The AFTER columns is 1000 characters. Perhaps should mention something about the limit of 900 bytes key lenght.
You're mistaking me for someone who cares enough.
Honestly I could barely be bothered to finish typing the answer.
@PaulWhite Was your comment flagged?
@ypercube No, I deleted it because it had served its purpose.
He edited most of the missing info into the question.
4:41 PM
ok. was worried after I read their rude comment.
Thank you for your concern then :)
I do not like replication
@swasheck Lot's of different beers.
sorry, I just had to get that out
@bluefeet What a scathing review.
4:45 PM
Are any of you using SQL Azure Databases at work (either prod or non-prod) yet?
Or Amazon RDS?
@JamesLupolt i've used them in the past ... we POCd the concept of them as an offsite DR node
@Zane I know right. I had to drop an article from a subscription but now I can't add the damn thing back in
@swasheck Was the POC successful?
@bluefeet "can't add ... back in" ... that's strikingly similar to "doesn't work"
@JamesLupolt depends on how you define success. yes. we set up a replica
@swasheck yup. When I try to add a single article to the subscription I get the very helpful message - Specify all articles when subscribing to a publication using concurrent snapshot processing.
gee thanks
I'm aware of that. However, when I ran it with all it generates a different issue with replication
have you tried the nuclear option? blow out everything and rebuild from scratch?
that's not a possibility
Also, consider MangoDB. It has 100% of the RDA for Replicantion
Sorry Paul, there is: IDX6 nonclustered located on PRIMARY TABLE, FIELD. Maybe this would change things you mentioned? — Atieh 1 min ago
4:52 PM
@billinkc no. mango is sharted

« first day (1515 days earlier)