« first day (513 days earlier)      last day (3490 days later) » 

3:00 PM
@Marc-Andre Experts....?
 
Nah, If I wanted to get your attention I would say "hog-riders are fools" ;-)
2
with bugs in their teeth.
 
@Phrancis lol
2
@rolfl lol
2
I think I am close to running out of stars just catching up there....
 
flushed out my own starred comment by starring @Malachi's lols
2
 
@Malachi Well I consider answerer expert. And it's "publicity", we do have "real" experts!
 
@Marc-Andre Agreed
I need to figure out why I can't get Ajax Control Toolkit to install into this Crappy VB.net site.... ugh!
be back when I figure it out
 
3:06 PM
suggested synonym:
3
 
only because is already a synonym for ....
 
3:22 PM
it's Legacy, and it's hooked into things just deep enough for me to not want to try and rewrite it. or should I? maybe I suggest that for my next project.....
maybe they don't want me doing it?????
 
Don't touch things you don't want to own.
 
It sucks to always work with 3-letter acronyms at work, now I keep typing every acronym I know instead of the one I want
 
All you need is one .... TLA
 
@rolfl I already own it....it's my project now...
@rolfl Texas Library Association?
 
Well, that was fast: or should I? maybe I suggest that for my next project.....
 
3:26 PM
lol #stuckinvb
 
@Malachi Three Letter Acronym....
 
@rolfl I had to scroll on my Google Search for that one, but did eventually see it...lol
 
@Malachi Your Google-fu sucks ... was item 2 for me:
TLA may refer to: Three-letter acronym or abbreviation == Organisations == Three-letter agency (e.g. CIA, FBI, FSB or NSA) Textile Labour Association, an Indian trade union, precursor of Self-Employed Women's Association of India Tour de las Américas, a professional golf tour in Latin America Territorial local authority, the territorial authorities of New Zealand == Entertainment == The TLA, or Theater of the Living Arts, a music venue in Philadelphia, Pennsylvania TLA Entertainment Group, a movie retailer and distributor TLA Releasing, a film distribution division The Lawrence Arms, punk band...
 
I think the reason it wasn't rewritten before I got here is because they didn't think it could be done.... but I think I can just rewrite it in C# and keep the extra libraries as well. but it would take some time
@rolfl I just searched "TLA"
 
 
3:29 PM
is that what showed when you clicked the link?
 
Malachi's Google must be broken
2
 
I got less results than you guys got..... weird......
Bad Chrome, Bad Chrome...
 
3:31 PM
Google is very subjective
2
 
 
and it took longer..... I highlighted and right clicked and hit search google.....
 
@rolfl quick question: I have a CTE that selects ~780K rows from a source; then I [inner] join with 4 tables and cross apply a table-valued-function - result is ~1.5M rows, ...and it runs in about 10 minutes. Does SQL Server perform the joins in the order I'm expecting (i.e. as written in the query), or it could be stupid enough to do the cross apply before doing the inner joins?
 
I love the picture of all the partying people.
 
@Malachi It's because 'murica' .... where .... nevermind.
@Mat'sMug It does it in the order that the explain-plan says it does it.
74
Q: How do I obtain a Query Execution Plan?

JustinIn Microsoft SQL Server how can I get a query execution plan for a query / stored procedure?

 
3:34 PM
VS2010 doesn't give me an option to change the framework for this site.....
 
Afbeeldingen = Images?
 
@Phrancis Yup
 
execution plan looks good... I guess I'm going to have to live with these 10 minutes.
@Malachi what version is it targeting?
 
@Mat'sMug 10 minutes to build and process 1.5M records, which is 150,000 a minute, which is 2500 a second. Now, that's not fast, and not slow either......
 
I think I'm going to put it up for review
 
3:40 PM
There may be room for improvement.....
 
2
Q: Learning python classes exercise. Dict of names and birth dates which prints with age at birthday of current year. Edit and save.

j-oAs a beginner (Learn Python the Hard Way) I've set myself this exercise with classes and it works but looks very inelegant to me. I'm trying to write classes which could be re-used in other code. I've left long variable names and comments so you can see what I thought I was doing. What should I f...

 
I was about to suggest that @Mat'sMug
 
Huh, if you put a row of dashes in a chat window, it creates a break between messages.... like:
 
This is after the break
 
uh, no
 
3:43 PM
and again.
 
oh wait
yeah
 
> (Hope this is the right kind of question - my first post.)
 
interesting
 
Wish more people had that attitude
 
@Mat'sMug some of the projects in the solution target 3.5 and others target 2.0, but when I go to the application tab of the properties there is no target framework field to change
 
3:45 PM
 
ok
 
lol
3
when I try to install Ajax Control Toolkit throught NuGet I keep getting an error like this
> Install-Package : Could not install package 'System.Spatial 5.2.0-rc1'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5', but the pack
age does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
 
Seems like a comprehensive message, and useful.... wow.
 
For some reason when someone uses ellipses, I always have the tendency to count them to see if he/she put exactly 3, or perhaps 4
 
@rolfl I think I need to change the framework to something like 4.5 or even 4.0, but then I hit the issue above
18 mins ago, by Malachi
VS2010 doesn't give me an option to change the framework for this site.....
or project
 
3:54 PM
@Malachi Targets .NET 4.0 or Silverlight 4.0
 
@Heslacher it can't create a packages folder because it doesn't have permissions for some reason, and so it can't install to a folder that doesn't exist, at least that is what I am getting from the output when I try to install that one package that is getting hung up
 
-1
Q: Algorithm to find the largest number from a list of +tive integers using while loop only

adnapGI need some help on how to write a Algorithm to read a list of positive integers from the user until the user enters the value -1. Once the user enters -1, the program displays the largest value in the input list. I do not want to use arrays. While loop only. please help. I am using visual logic ...

 
@Malachi never had that problem
@CaptainObvious Off topic
 
I created it, and it deleted the folder when I tried to install again....
 
@Capt FCITW
 
3:57 PM
How about (for testing purpose) to add the package to a new 4.0 project ?
 
@Phrancis naaah hammer is always faster ;)
 
Wow, you guys are getting good......
 
@Malachi you can't retarget the solution, you need to retarget each project
 
closed in minutes.
 
@Mat'sMug regarget?
 
3:58 PM
... regarget?
 
ugh.. can't even blame the phone this time ;)
 
If I were drinking coffee now, then I would've splitted it!
2
 
@Mat'sMug it won't let me retarget any project
@Mat'sMug star slap
 
@skiwi splitted?
 
@rolfl splitted spilled
 
4:03 PM
What does the light blue highlight mean? ^^
 
@Phrancis it is one of your favorite tags
 
Ah ok cool
 
Spent the working day with JavaScript, HTML and CSS... I had to think "How would I do this in Java?" when I was fixing a bug in a JS script
 
Monking..... and how was work today ... ? ;-)
 
4:10 PM
Monking @SimonAndréForsberg
 
@rolfl HTML, CSS, JS.... enough said?
Well, at least I didn't do any PHP...
 
Nope, it should be: $$$ nuff said
 
And I actually worked on something quite fun in JS...
I did some refactoring!! :D
 
hmm My latest SEDE query shows, that in my best Answer I earned an upvote every 40 characters...
well every 42 on SO..
 
posted
0
Q: Normalizing Invoices

Mat's MugI need to move data from one database to another, and since I don't have SSIS I'm going this ETL with T-SQL scripts. One of the source tables contains invoice details, and features a column that contains the number of units invoiced per size (it's clothing); as I transfer the data over to my dat...

 
4:24 PM
2
Q: Normalizing Invoices

Mat's MugI need to move data from one database to another, and since I don't have SSIS I'm going this ETL with T-SQL scripts. One of the source tables contains invoice details, and features a column that contains the number of units invoiced per size (it's clothing); as I transfer the data over to my dat...

 
@Captain well that was fast! like, a new record!
 
@Mat'sMug don't get used to it...
 
IKR
 
@Mat'sMug I like how you write your SQL, not a big fan of SHOUTCASE personally ;-)
 
@Phrancis well we had that discussion, right?
In code querystrings it IMO has its reasoning.
 
4:27 PM
@Mat'sMug Is the 10 minutes when run as an Insert, or when run as a query?
 
query
when I uncommented the insert it took just below 12 minutes
and when I ran it again it inserted 0 rows in just above 10 minutes
every table read is a clustered index scan, perhaps I should specify
except the source table, a table scan, but it doesn't cost me much. The join with the BucketString results is costing 32% with nested loops.
 
I am going to rewrite a portion of the code, right now it utilizes an entire ASPX page when there should be a dropdown instead.... going to be fun to rewrite though....
@Mat'sMug how big is the text you are expecting, isn't varchar(max) only like 6000 characters?
 
lol it's 21 buckets of 5 characters, padded with a whitespace, plus 1 offset on the left, so 127 characters.
but the function is intended to be generic, and it will be reused.
but yeah varchar(max) is probably way too much for every use case.
 
I was worried you had a lot of text going in there....
better to be on the high side anyways
if you know for a fact it won't ever be over 500 characters you could varchar(500) or something like that, not sure what the performance increase would be though...
 
@Vogel612 I was looking for our discussion, and found this gem:
Mar 2 at 18:33, by Vogel612
given the case Bob stores the cookies in the men's toilet, what would happen if alice tried to redeem her cookies??
 
4:39 PM
if I do select * from Staging.dbo.[SourceTable] the table scan runs for 49 seconds and selects 780,173 rows.
I can create indexes on that table if needed, but the execution plan isn't suggesting any, so I haven't.
 
@Mat's ... can you experiment on the database now?
I would like to see the left-join removed, and replaced with a not-exists......
......
 
actually there are already indexes on f1 and f2
@rolfl interesting.. I do the left join check on every table I'm transferring over..
I'm a bit in the middle of something right now, but yeah
 
and not exists (select 1
                      from [DestinationDatabase].dbo.InvoiceDetailSizes dst
                      where detail.Id = dst.InvoiceDetailId
                         and sz.Id = dst.SizeId)
 
^^ running (with execution plan)
 
Toodles!
 
4:47 PM
toodles!
 
doodles
 
Poodles!
 
muggles
 
@Malachi that will be a very minor improvement, but given the function is called almost a million times in that single script, I'll take it.
noodles ...time for lunch
 
@Mat'sMug I suspect the performance will be about the same..... honestly, I imagine it was smart enough to translate the == null as a no-exists.
But, the logic is clearer.
 
4:48 PM
it's 4 minutes into it
 
The cross apply is not functionality I am familiar with.... and, it woul dbe my next suggestion, especially if it can be moved in to the CTE..... somehow.
 
@Mat'sMug there are a couple of equations that you can declare outside, but the variable declaration might also take time, but it might outweigh the cost of having them inside the query happening every cycle....
 
@rolfl I thought of that, but then I thought if the joins occur before the function call...
..then I'm only calling the function on the rows that matter.
 
meh, you may be right...... I see an amplification of data though, the joins will be reproducing the same cross apply for the same source records multiple times (since you start with .75M records and end with 1.5M).
hate to say it, but experimentation is the name of the game, maybe.....
I think the 2500perSecond is sounding quite reasonable....
Damn, still running.
9 mins ago, by Mat's Mug
^^ running (with execution plan)
9 minutes so far.
 
yep.
11:40 and still going
looks like the left join is faster :P
12:06
well you only added a clustered index scan at the end, that hash match is costing 19%
and its a right anti semi join
the function call was 8%, now 7% - something else has taken a hit
 
5:00 PM
the right anti-semi-join should be fast....
the 7% is probably because of the increased runtime overall.
 
yeah
 
You are probably not pulling actual IO data though, so the data may be 'cold'.
there may be different contention patterns too with other queries running.... too many variable.s
 
hmm I'm pretty much alone on that server :)
well until people start using the report server I set up
 
Was the last thing run on that server the same query?
(i.e. the data was all cached?).
 
was probably gone from cache
but the first-first I did with mine run was below 12 minutes
 
5:04 PM
OK, I am not really arguing here ... ;-) Just musing....
 
You should edit that into your question @mug I think it adds value overall to have the exec plan
 
@Mat'sMug Look at the table scan and right anti-semi join.
 
@Phrancis I'm running my query again, that's the query plan with @rolfl's amendments
 
@Mat'sMug I was thinking that was a git network graph for a second...
 
5:09 PM
0
Q: Refactoring really large nested function

jeremyhOK we have currently rewritten an Excel calculation engine in F# and are looking to refactor the code to make it a lot more idiomatic and standardised. One of the big problems with the code is that we have a massive function named companyModel that builds a CompanyModel type (a record type that ...

 
Oh
 
@RubberDuck there's no getting away from the table scan - I'm actually traversing the entire source table... or can it be turned into an index scan somehow?
 
@CaptainObvious If anyone is currently editing this, speak now. :P
 
@Mat'sMug Won't be much difference.... you're going through all the records anyway.
 
that's what I thought
 
5:18 PM
About how large is the result set of function [dbo].[BucketString]?
 
up to 21 rows, often only 1, most often 3-4
actually given the result size, average would be closer to 2
@rolfl finished in 12:01
 
Ok, essentially the same.
is that returning 0 records?
 
yup
 
poll of the ---week--- monday:
"right_aligned"
or
"aligned_right"
?
 
So, essentially, the entire cost is in the not-exists.
what happens after that, is not computed......
What is the clustered index on [DestinationDatabase].dbo.InvoiceDetailSizes
 
5:26 PM
I put the query plan into the question
 
I still suck at chat formatting even if I do exactly as described in the faq. interesting.
 
it's absolutely unreadable though
 
After reading up more, Rust looks awesome! doc.rust-lang.org/nightly/intro.html Only really a pity that it uses the let syntax, instead of letting the programmer provide a fully parametrized type (like Java), as now it leads to strange constructs
 
@Mat'sMug if you use Chat here to make a link, and post the link to the picture instead of the picture itself it may be better
 
I just did that - you can now click the picture, it's linking to itself ;)
still, hardly readable
but I don't have funky tools here, unlike some...
note it creates a right outer join instead of that funky semi-not-sure-it's-a-join thingy
 
5:29 PM
@Mat'sMug - do me a favour, and create the index: create unique index AK_CRTest on [DestinationDatabase].dbo.InvoiceDetailSizes (InvoiceDetailId, SizeId, Id)
You can do? or is that too much change?
 
done. and running
that DB is all mine, so is the SQL instance itself - even the server it's running on is my own little playground.
 
OK, the problem I am anticipating with your query is the clustered index use of the table.
Clustered means that the data is the index... (stored in index order), with some hashes outside that make it fast to look up.
the problem is that the index I presume is on the ID.....
 
clustered means the index is stored in the same order as it's physically stored on disk
 
and we want to access the data via the InvoiceDetailID.
@Mat'sMug That is true, but it also means that all of the non-index data is stored with the index data.
 
you're right about that unique index though, I didn't have one (but there are FK's to all related tables)
 
5:34 PM
I am hoping that the index just created is a 'covering' index for the query, and that it will be significantly smaller, and have a better access path for the query.
If the query is still running, I suspect that it did not choose to use the index.....
 
hmm
4:40 (still running)
 
nice... ;-)
Oh....
I should have asked you to set no execute .... and just show the plan.
You should possibly also update statistics ;-)
 
that's where my DBA skills end
 
Actually, I bet the statistics were taken with an empty table .....
You have done an update stats... right?
 
nope
how do I do that?
 
@Mat'sMug Snag It FTW!
 
@rolfl should I run this overnight every night along with the rest of the ETL process?
 
times have changed a bit. It seems that there are settings that MS recommends that keep the stats auto-updated when changes exceed thresholds.
It is possible your stats were already up to date.
 
it's SQL 2014 Express
 
5:44 PM
But, there is no damage in running it now, and learning about it later... ;-)
 
12:03 completed
..and didn't use the unique index
went with the clustered one
 
And that... sucks (three . for ellipsis for @skiwi).
 
looks like this is going to be about micro-optimizations. @Malachi might be spot on
 
No, that clustered index lookup is a problem..... the clustered index is on Id for the dst table?
 
yup
 
5:48 PM
@Mat'sMug Did it pick up a new query plan? It's best to make sure. If it didn't, clear the plan cache and run it a few times.
 
So it is joining from the src table to the Dst table using an index it does not have the value for ;-)
 
What on earth...
> This message is too long.
Oh...
No copy pasting then
 
@rolfl then... instead if where dst.Id is null I could say where dst.SizeId is null and dst.OrderDetailId is null and it should pick it up.
 
or use the not-exists variant.
which does not use the where clause values, or the left-outer-join ... right?
 
@skiwi The first reply ..
 
5:55 PM
@rolfl maybe putting the id in the where clause is what's telling SQL Server to use the clustered index
oh gosh.. I had included the Units column as part of the UQ index' key
 
evening
 
hey @janos.
 
hi!
 
hey guys
 
@skiwi Here's an old-timer's version: macs.hw.ac.uk/~pjbk/humour/polynomial.html
Cute Poly Nomial and Curly Pi
 

« first day (513 days earlier)      last day (3490 days later) »