« first day (1276 days earlier)      last day (3889 days later) » 

04:03
FRICKIN ABUSE OF FRICKIN PARTITIONING IS FRICKIN ANNOYING
0
Q: Is DBCC SHOWFILESTATS an accurate way to see unused space?

Ek0nomikWe have a few tables each with near 100 million rows of data. A co-worker has these tables setup with partitions based on a date field. Our disk space is starting to run low and knowing that partitions have their own file group, I wanted to see if some of the partitions were larger than they ne...

@MarkStorey-Smith like flies to a rotting corpse ...
 
2 hours later…
06:26
@swasheck Am I a bad man because I answered that question. ;)
06:38
Am I the only one wondering how this is an "abuse" of partitioning?
07:08
Hi @PaulWhite. Do you happen to know what this is about? "In earlier versions of SQL Server, queries against an XML document that contains strings over a certain length (more than 4020 characters) can return incorrect results. In SQL Server 2014, such queries return the correct results." from Behavior Changes to Database Engine Features in SQL Server 2014. Google is failing me or I just don't know where to look.
@MikaelEriksson Nope, not heard of that before.
Ok, thanks anyway.
 
3 hours later…
10:20
@MikaelEriksson I wonder if the word "contains" in the description is significant
@PaulWhite Ehh, sorry I don't get it?
@MikaelEriksson In the Remarks section
"The substring value specified for $arg2 has to be less than or equal to 4000 characters. If the value specified is greater than 4000 characters, a dynamic error condition occurs and the contains() function returns an empty sequence instead of a Boolean value of True or False. SQL Server does not raise dynamic errors on XQuery expressions."
Ah, you mean it could have something to do with the bug that is fixed in 2014.
@PaulWhite I don't have 2014 to test on but this demonstrates the error in 2012
declare @X xml
declare @S nvarchar(max)

set @S = replicate('A', 4000)
set @X = '<X>'+@S+'</X>'
select @X.query('contains((X/text())[1], sql:variable("@S"))')

set @S = replicate('A', 4001)
set @X = '<X>'+@S+'</X>'
select @X.query('contains((X/text())[1], sql:variable("@S"))')
10:40
@MikaelEriksson Huh. Same result in 2014: true then empty sequence
So it's not that then. I'll ask someone, see if I can get a proper answer for you us.
2
Ok so no difference there.
 
3 hours later…
13:39
@PaulWhite well --- first off it appears that they're not rolling off the data to slower storage
secondly ... i dont know
13:54
Queue Stephen...
0
Q: Restoring Database tables in wamp

agbo agboPls, i recently formated my system without exporting my database file from my phpAdmin in wamp server. How can i restore back my data from "C:\wamp\bin\mysql\mysql5.6.17\bin"? thank you

@Concerned how did the drinkies go?
@ypercube It was great to meet James - I hadn't met him before
we missed you though :)
@ypercube Fine. How was the trip to Greece?
@JackDouglas He mentioned watching football and drinking cider. I think he was there in spirit.
FIne. I'm still in Greece. Returning Monday.
Quite hot here.
14:06
in the 40s?
@JackDouglas No. 30 to 35 but quite humid.
14:20
@MikeFal no. it's pretty close to an answer i was in the middle of posting. also - you're a bad person for many other reasons
@billinkc hahaha
@JackDouglas Celcius always throws me off.
40 is super chilly.
I suppose it would be! We have a mix of units over here but I've never used fareinheit. Cant even spell it.
lol @ this answer
6
A: strtotime logical error in comparing dates

Niet the Dark AbsolYour "logic" is wrong. > xkcd $a = '2014-07-03'; $b = '2014-03-17'; $c = '2015-03-16'; if(($a > $b) && ($a < $c)) { echo "1"; // it works! } Big-endian formats are awesome.

@Lie I don't buy it. The waste in every single case can't possibly compensate for the savings you get for the (hopefully rare!) scenario where you are changing columns. The query should probably be reviewed in that case anyway because if it is joining or filtering on columns and you've added/dropped/renamed/moved those, won't the query still have potential problems? And if you've added columns, are you absolutely certain the application will actually want to use all of those columns? Perhaps not, in which case pulling them is a total waste. — Aaron Bertrand ♦ 4 mins ago
14:39
I know nothing about the heirarchyID datatype
Used it for the first time on my last gig. We were shortening hierarchies for security purposes (A reports to B reports to C but B is unfilled so make it A reports to C)
So I've started ending all of my phone calls with debt collectors with "I love you bye." and I'm a pretty big fan of the results.
15:15
sql fiddle has been dead today
@bluefeet works for me
@Lamak can you create a schema?
I get error
> datasource [sqlfiddle] doesn't exist
@bluefeet mmm...not a new one, but an old one worked
@bluefeet the uptime of that site is terribad
and now it doesn't
15:18
it's been down alot lately
15:29
Uh what?
-1
Q: tsql query result in same column out of custom strings

Jib LénaI'm trying to fill a table parameter returned as a first table of a stored procedure. I want this table to contain 'Parameter1', 'Parameter2', 'Parameter3' in a column named 'Parameters'. All data is not from any database table it's just hard coded strings right in the stored proc. It's a query ...

Hi everyone, is there any particular reason the restoration of mysql database to suddenly become slow?
The conversation that's happening behind me is making me sad.
@Kermit He might as well have asked if he could fill a table with peanut butter. I have no clue what that man is talking about.
@Ramesh running out of resources?
@kermit, I don't think am running out of resources.
@Ramesh I read that as "Is there any particular reason for MySQL Database?"
:)
15:32
@Zane, ha sometimes when I type faster, I miss the grammar part. :)
@Ramesh MySQL sucks. So that could be a factor.
@Kermit, I edited the configuration file as well believing the restoration could happen faster.
@Ramesh I don't think there's any MySQL folks in here at the moment.
@Kermit, no problem :) I was just curious to know. Actually I had posted the question in the site as well.
I think I speak for the group when I say. What? — Zane 7 secs ago
@bluefeet that's borderline constructive right?!
15:45
@swasheck Why do you have a different name on DBA.SE for your user? I am now very confused.
@Zane borderline
@MikeFal trying to be cute before the world cup ... hated it
@MikeFal he changed it for the world cup fever
and then he regreted it
but now stuck for the next 7 days
but changed my network account to be through SO so i appear as swasheck in here
You should have changed it to TimHoward_SecDef
15:47
At least they're honest
0
Q: T-SQL/SSIS - Tables locking after redesign with primary/foreign keys

Noob-o-tron 5000I've managed to get myself into a bit of a pickle, I did a quick redesign of the tables used in a notifications system & have managed to make the things entirely useless. Any attempt to use them (select/update/insert/delete/alter) results in a query that runs indefinitely. I believe that I've ma...

@billinkc i had to close that, my eyes bled
longest title ever
0
Q: SELECT rows having equal column(c1) value and adding adding another column(c2) value. Performing same for all the distinct column values for column c1

user3802385I need to write an SQL Query for MySQL Database which gives me the data according to the necessary conditions I have a table having structure like this id: orderId amount : itemAmount rate : itemRate time : orderTime Now I have to select all the rows having same rates and then have to add all ...

@bluefeet In ping pong the boarder counts as in.
My mind is 100% interested in the weekend and cares not for work.
16:27
@JNK or @MikaelEriksson or someone with some XML knowledges
<DATA>
    <ROWS>
        <ROW EventID="1" />
        <ROW EventID="2" />
    </ROWS>
</DATA>
should be easily parsed as
SELECT
a.d.value('@EventID','nvarchar(100)') event_id
FROM @xmlData.nodes('/DATA/ROWS/ROW') a(d)
right?
(where @xmlData is the above structure read into an XML-typed variable)
yup
(not that I know anything about XML, just tested your example)
ah ... i overlooked a vital aspect
go on
FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
namespaces
i am le dumb
JNK
JNK
yeah namespaces kill it
You can set the namespace using a WITH
16:37
discovered that :)
@swasheck well, glad I helped you in your rubber duck debugging
JNK
JNK
:)
thank you Jerrad
2
A: Parsing XML using TSQL

JerradYour XML namespace is messing things up. Either remove the xmlns="http://data.fcc.gov/api" from the Response element, or prefix your query with WITH XMLNAMESPACES ( DEFAULT 'http://data.fcc.gov/api') ;WITH XMLNAMESPACES ( DEFAULT 'http://data.fcc.gov/api') SELECT x.i.value('@name', 'varchar(200...

@Lamak i've read the blog post 3 times and i still dont understand the metaphor
(also - i'm parsing government data :))
@swasheck you were explaining your problem to me (me being the rubber duck I guess). I didn't do anything to help you (just like a rubber duck wouldn't either), and you figured it out by explaining your issue
thanks for the help (on both accounts), @Lamak
75,217 aviation incidents :)
16:41
@swasheck no problem
not a sizable dataset
17:04
any particular data set you're looking for?
Actually, since I can't access my skydrive, I couldn't even link you my public dataset thing even if I wanted to
JNK
JNK
@swasheck that's a known debugging method
basically you explain your problem out loud
I just swear at the rubber duck.
17:19
Hey all
Howdy
I can see a potential long winded debate happening on a question and just wondered what would you suggest the best way of killing it is?
Nuke it from orbit, only way to be sure
Or link it here and the swarm mentality usually takes care of it
But there is a close reason of too opinionated
Oh darn, my satellite went down this morning for maintenance...
Its actually in the comments
I am tempted to reply with:
> I think its safe to summarize that retrieving unnecessary data is wasteful and should be avoided no matter what the scale of data involved. The purpose of the ORM is to map data from the table to an entity. That entity does not have to be the same entity as that generated by the ORM toolset.
Ah, well you already have Aaron in the comment thread and he's a mod so that usually works itself out. We generally just disengage from the trolls. You can try flagging comments as Too Chatty or Other and explain your situation to the mods.
I'd also favor pulling any useful comments of yours into your answer proper so that if a the comments get cleaned up, your knowledge remains in the answer instead of disappearing into the ether
3
Huh. Data Space 113GB. Index Space 616GB
17:44
anyone know of guidance around not doing backups to the same drive as your log files?
@billinkc ??????
@Zane lots (too many?) indexes.
@billinkc is that at your shop?
Si. Lots of indexes. Lots of redundant indexes. Lots of really fat indexes.
Which is what happens when you build a table out of guids
A consultant said that we might be able to offset the tempdb contention and such that happens when we do these joins as queries vs bringing both into memory and using a merge join.
I'm willing to give it a shot but since we'll have to sort the data anyway... I don't know that it's going to buy us mutch
Guids suck in a big way.
17:52
Did you see my tweet yesterday? One table had 121 guids in it, 300+ columns in total
Clustered on a non-sequential, composite guids
Completely unrelated, but they also have some performance issues...
@billinkc More is better!
we need more database!
@billinkc firing squad for that dev team
Cheques have long since been cashed
finally ... a sizable data set but now i have to cleanse and normalize it
WHAAAAAAAAAHHHHHHHH
arent there any large data sets that are already normalized? :)
JNK
JNK
@billinkc lol
17:57
adventureworks big?
@swasheck what happened to the SO data dump?
@Lamak still has to be normalized
Too many bad questions in there
JNK
JNK
@billinkc I built my database out of garbage, why does it smell?
Skews the results
@JNK I know, rite?
17:59
@billinkc i want lots of data so that i can test some stats
VtC, needs more clarification
@swasheck what is an acceptable size?
@Lamak heej
with lots of varying data
@swasheck heej?
18:01
i guess SO would work, but i'd guess i'd need to know what kinds of questions to ask
@billinkc i'm using Denver's 311 phone calls.
Same diff
~3 million rows ... (raw)
but normalizing it is ... tedious
oh well
i guess i'll get on it
@Lamak nice
Seems that many cities have teamed up with Socrata to put the data online. Might be able to cobble many cities data together. Hmmm that could be fun
18:03
@swasheck maybe the credit sample one?
@swasheck Ok thanks. I don't necessarily disagree, I just wondered what you had in mind.
@PaulWhite yeah. it just seemed like the one who made the decision to partition just did it thinking it was a magic bullet. all partitions on the same disk, not switching in/out
@Lamak that looks big
@swasheck The "contoso retail DW" one seems to fit your requirements:
> Let’s say you want to do something a bit more adventurous and you want to branch out into the bigger BI world that Microsoft has to offer. The AdventureWorks data sets are a great starting place, but the data set size doesn’t pose many challenges.

The Contoso Retail DW data set is several times the size of AdventureWorks and comes as a pre-built star schema. While it’s not the biggest database (my copy is around 1.6GB), ContosoRetailDW provides a large enough data set where aspiring database professionals can really start to push the limits of a local SQL Server.
@Lamak thank you. that's truly awesome
@swasheck it comes normalized, so there's that
18:05
With every waking moment my hangover becomes a little more unbearable.
@swasheck why do you need lots of data. Just use less data on a shittier system.
@Zane i want a lot of data to skew stats-related results for my potential sql sat presentation
@swasheck well, hopefully one of those sample databases can help you
thanks HeapTeam!!
partition problem day.
0
Q: remove sql server 2012 table partition

user42148I would like to remove a partition from a table SQL Server 2012. The table has primary key but the partition column is not a primary key.I would also like to keep the data structure and schema intact. I did select * into [dbo].[new_Non_partitioned_Table] from [dbo].[partitioned_table ] and the...

18:45
@swasheck or "embiggen" the AdventureWorks one?
@Marian SLEEP!
you dictator! just woke up :D.
Did you tell the Heap what fool you hired? :)
@swasheck I don't know if this would be a candidate for a large enough db: archive.geneontology.org/latest-full
i want to know the fool
@Kermit me
18:56
@Marian i pity the fool
Today I tried recreating the replication without knowing the distributor admin password..
was close to cause an outage, too nice that Mark saved our burning pants
@MarkStorey-Smith as a lullaby now I have Joe Sack's replication course on PS.
Next time we'll probably try to cause a bigger problem :).
@Marian Good man :)
Someone on DBA is going to trip the serial upvote for me
> Thanks for hinting me
I had figured it out - Thanks for hinting me - @bluefeet — user41979 8 mins ago
19:12
@bluefeet that's a f.. big hint.
@billinkc you need a serial downvote to compensate
Agreed, be so kind as to compensate?
aye!
@Marian yeah, you think :)
@bluefeet even said it loud :).
19:18
@MaxVernon wtf is this? gene ontology? neato
now i'm stuck trying to assess
which data set
@Marian it's already accepted though
@Lamak accepted 45 seconds ago ;).
Clue by four
@Marian oh, didn't notice it
@swasheck yeah, I think it might be an interesting database since it should have a good selection of data, and it is real-world data, not "made-up".
19:25
@Marian very nice
19:48
lazyweb. I have an actual execution plan. My estimated rows, 93M is significantly less than actual 6M rows. Plan explorer has proposed that statistics may be off for my query. There's no way for the tool to show me where the stale values may lie, is there?
Mouseovers. Nevermind, I think this is where the dumbness here was infecting me
@swasheck are you sure you don't want to move to phx we are hiring a sql person?
@bluefeet definitely. unless it were six figures, the first of which started with a 2
@swasheck ha, ok
Sure, they'll pay you six figures starting at 2 but you can only bill for half the year and donate the other half "for the good of the company"
@bluefeet Hey, if anyone is stealing @swasheck, it's me and @simonrigharts for NZ.
19:56
You already got your steal for the year
@MikeFal I'll fight you for him
@bluefeet you really wouldnt like working with me.
@bluefeet ... @MikeFal is enough of an a-hole to handle it
Your hand looks funny
20:28
Your face looks funny. Funny like a clown stalking children.
Is that wrong?
@swasheck well, I can't even convince you to come here for a holiday, so I give up on that fight
@Lamak eh ... one day
20:48
I want to go back to Chile. I still have my vacation home picked out there in Zapallar
really?, nice
And this is the view looking the other way
pretty
Now if only i could get rich enough to be able to afford it
20:53
Bah, I left to free up some budget for you :P
$120 is a start I suppose.
Whoa, I'm not a high roller like you. Even if you account for New Zealand rupees or whatever currency you use there
Rupees LOL. Nice.
21:11
Anyone else get duplicate header error or is this some dumbness on the part of websense? sqlsaturday.com/viewsession.aspx?sat=191&sessionid=15953
21:23
Micro-optimization my ass
@Lie please don't assume that pulling all of the unnecessary columns in a table is always going to be a matter of microseconds. This can vary greatly depending on number of rows in the table, number of columns, the data types (try 50 geography columns and a bunch of MAX/XML, for example), how many columns are computed but not persisted, speed of the network, efficiency of the client app to consume, etc. Your argument about microseconds seems to be limited to the test app on your desktop working against 10 rows of BIT columns. — Aaron Bertrand ♦ 49 secs ago
@billinkc working fine for me
this answer misses the mark
Where did the app, computer, version and build columns come from? They are nowhere in the question. The date_entered column is already datetime, why do they need to cast it? Are you sure you answered the correct question? — bluefeet ♦ 2 mins ago
@AaronBertrand this also seems wrong
@AaronBertrand: if you always default to pulling all columns, then during development you wouldn't need to modify the query every single time you figured that you need a new column or when you decide later on that it turns out you don't actually need/want that column. In the rare case where selecting specific columns are measurably beneficial, the queries that specifies columns would appear highly unusual, an becomes a reminder that that particular query require extra care. — Lie Ryan 53 mins ago
@mmarie Might I humbly suggest contracting?
@Lie And then again, the developer doesn't always know what's in the table, so may not know that SELECT * pulls a bunch of crap they don't need, accesses columns they have been denied access to, etc. While I understand why developers love SELECT *, there are a ton of reasons why DBAs are against it. Development time and maintainability are a drop in the bucket compared to application response times. Maybe you're in a shop where management cares more that you can write a query in 10 minutes instead of 11 minutes; don't assume that's true for all of us. — Aaron Bertrand ♦ 33 secs ago
 
1 hour later…
22:45
@AaronBertrand I was going to add a comment but I should probably wait until I'm sober-er
It might have come across a bit mysql-scriptmonkeying-whatareyoudoingarguingondba.se-typething
2
Following up after "performance only matters when it matters" folk is my primary source of income!
@MarkStorey-Smith can I borrow that line? I'm sober.
@AaronBertrand All yours. After all, you've got a building full of people cashing in on that problem :)
@Lie And if "performance only matters when it matters," please let everyone know where you work. Consultants, trainers and performance monitoring tools vendors like me build their entire livelihood on such statements... — Aaron Bertrand ♦ 6 secs ago
I can add a reasonably sober relevant comment to follow that... IN I GO
@Lie I've been called in to deal with 3 distinct and separate performance issues as a result of misapplication of ORMs in the past month. Performance matters as soon as there is a financial implication to its absence. — Mark Storey-Smith 17 secs ago
Hows that?
Super.
22:54
Nice
Though "distinct and separate" is clearly the wording of an inebriated individual :)
@PaulWhite That's sober talking if ever I heard it
Ha! Excellent.
6K views on SELECT *
Hello wall
@AaronBertrand: the query will fail the second the dev tried it, what time is lost? You may want to provide a view that selects the columns that the application developer had permission on, or the application developer may write a helper method that excludes those columns. — Lie Ryan 40 secs ago
23:00
I'm guessing that guy's wife is withholding right now. May have been for quite some time.
LOL, I'm out, have a good weekend chaps (holiday for us tomorrow)
cheerio chap
Hey I'll be in Telford at Bits, you going anywhere near there?
When's bits on?
July 16th-19th or so
23:02
@AaronBertrand Googled it... flying out of UK on 13th unfortunately. Next time!
Bummers
Oh wait, in the UK that's something else. Uh, shucks.

« first day (1276 days earlier)      last day (3889 days later) »