« first day (1704 days earlier)      last day (3164 days later) » 
02:00 - 21:0021:00 - 23:00

2:00 AM
@PaulWhite High data volumes would seem to make eav poop itself. But that's because I'm dumb.
 
 
1 hour later…
3:19 AM
@ypercube I wasn't able to find anymore concrete evidence regarding the 1/300 of a second UNIX link, so I softened the tone in my answer. In my research I discovered that Sybase has the same 1/300 sec accuracy but a slightly different rounding point than SQL Server. I thought that was interesting so I added it.
 
@swasheck Wrote something very similar over the last couple of years. Used EAV at the outset so we could itterate our collection routines rapidly. Used PIVOT views for extraction, dynamically created each day to reflect any new attributes that appeared. After a few 100M rows that became grindinly slow, mostly due to extra weirdness we had in our architecture.
Now use those PIVOT views to populate "normalised" tables after each collection. New attributes auto-generate an ALTER TABLE.. so there's never a miss-match.
 
 
1 hour later…
4:26 AM
Someone online?
 
4:53 AM
good morning
 
@AndriyM Can I ask you a question?
 
5:17 AM
@BrunoAlano Go ahead
 
6:08 AM
Hi
@JamesLupolt Maybe I misinterpret, but that's Perfmon counters avg disk sec/read over 5 min intervals, and it stays high until they go into lunch break
 
 
2 hours later…
8:04 AM
-1
Q: nested set model with multiple trees in multiple tables

Vahid AlvandiI have develop a MLM (multi-level marketing) system and so use nested set model in hierarchy users. A tree in MLM may have over 1,000,000 rows. It also should have multiple tables where each table is another nested set model. At the same time, all trees belong to one forest. With this approach ...

I need garlic
 
8:17 AM
Or maybe it will be enough if we just shed some light (on how things work on the site)
 
8:43 AM
@Erik Nice. You got my upvote ;)
What I'm not sure if the expressions "Notice that the least significant digit can only have one of three potential values: "0", "3", or "7"." and "but their least significant digits are a touch different at "0", "3", and "6"." would be more accurate as "... the least significant digits are rounded to one of three potential values: "0", "3", or "7", when the values are displayed"
I mean I'm not sure about the actual implementation detail. Are the values stored for example, as .997 or as 299 (of the 300 1/300ths of a second) and are only rounded for display.
 
9:24 AM
11
A: Why does my query search datetime not match?

ErikAs several others have mentioned in comments and other answers to your question the core issue is 2015-07-27 23:59:59.999 is being rounded to 2015-07-28 00:00:00.000 by SQL Server. Per the documentation for DATETIME: Time range - 00:00:00 through 23:59:59.997 Note that the time range can ne...

 
 
1 hour later…
@dezso I know, we were fixing the same typo at the same moment!
Oh, different edit.
@dezso Mostly that one was about showing Gianluca how to indent using standard markdown rather than <br><br>, but I thought I would pretty up the link while I was there.
 
@PaulWhite Funny thing. Got the message "Please mark this as the accepted answer" while on phone. Looked at it and thought that was nice of you but I did not think OP would be pinged by it.... scrolled up a bit and found out that he was :)
 
@MikaelEriksson Indeed :)
4
Q: Why is the secondary selective index not used when the where clause filters on `value()`?

Mikael ErikssonSetup: create table dbo.T ( ID int identity primary key, XMLDoc xml not null ); insert into dbo.T(XMLDoc) select ( select N.Number for xml path(''), type ) from ( select top(10000) row_number() over(order by (select null)) as Number from sys.columns as c1, sys...

^ context ^
 
Thought I would leave it there for a while and accept later if no one else had anything to say. Forgot about it.
 
 
2 hours later…
JNK
12:39 PM
thanks everyone for feedback yesterday on deployments
 
1:03 PM
@JNK I'm sad you didn't take my route
@bluefeet are you around?
 
@Lamak she's at work
 
damn, I knew that work wouldn't be good
 
JNK
1:17 PM
@dezso she works here!
 
@JNK I feel like my sense of humour is a bit cryptic
 
"sense of humour"
 
I've heard that
 
@dezso I'm not sure if the target was you or JNK. Or both.
 
it was probably @billinkc, based on the identity of the poster
3
 
JNK
1:26 PM
sorry I'm very literal today
 
How's that going to work?
3
Q: User Privacy Settings: How can I model this JSON in a DB?

John SmithOn websites, like Facebook and Google+, you find settings (a.k.a. Privacy settings) which allow you to decide who is allowed to see what you share. How are such settings structured, or what is the Database schema for achieving such functionality. I have no issues with programming, only DB design....

There's a bounty of +50 on offer but the OP's only got 40 points?
Hoping for some up-votes in the meantime?
 
@Lamak yes
what's up?
 
@bluefeet I was just wondering what's the right way to go with spam on SO that takes some time on getting canned
 
Aaah! "All bounties are paid for up front."
 
1:32 PM
would editing the text of the question be counterproductive?
 
@Lamak spam flags get the attention of mods typically faster than other flags
 
@bluefeet I had just flagged a question as spam, and it took nearly 6 minutes to get deleted. I though about editing the question in the meantime, but didn't
 
@Lamak no need to edit it out
it will get handled
 
ok then
those [C A R A 5] things are getting annoying
 
2:00 PM
@Lamak CARA5 ?
 
@ypercube Are you saying that Sybase or/and SQL Server might round for display? 299/300 = 0.996666666666666666....
I don't see the benefit of storing one value and then displaying another, so I assume the displayed value is a 1:1 mapping between what is stored...
 
@Erik It could be.
But it could also be that the values are stored as 1/300 of a second ticks.
@Erik (and yes, Sybase rounding down and SQL-Server rounding to the closest.)
 
@ypercube We've been getting hit by spammers
 
CARA means black in Turkish. Are the spammers from Turkey?
 
@ypercube some spam
 
2:11 PM
I'm not sure where they are from
 
@ypercube CARA means face in spanish
 
@bluefeet you and your house survive the monsoon season ok in Arizona?
 
It's kind of funny - and sad - when people think that WITH needs to be ;WITH
2
No actually it has been COMMON TABLE SYNTAX ;WITH like that it follows in MICROSOFT SQL Server — Jonathan 17 mins ago
 
@mmarie It's been a rough few days but yes we've survived
 
@ypercube Hahaha. Nice.
 
2:20 PM
@ypercube I use them at the beginning too in SO, because some users copy paste it directly on their code and then comment that it throws an error (because they didn't use the query terminator in their previous code)
 
@Lamak But you do add one at the end, right?
 
right
 
@ypercube I don't think they are storing it as 1/300 of a second ticks because 2^48 ~= 2.815 x 10^14 where as the entire range of legal "ticks" for datetime's range would be ~7.801 x 10^13. That means using the 1/300 ticks they could have saved 2 bytes and had a bigger range.
@ypercube yes that ; issue with the WITH for a CTE is clear cargo cult programming
 
JNK
2:36 PM
@Erik I do it still
mainly b/c I don't properly terminate everything with a semicolon
don't tell Aaron
2
 
@JNK me too, but the difference is we know why we do it. We don't put it in a view and then scratch our head wondering why the view syntax is "different"
@ypercube you might have lead me to the 1/300 second answer sql-server-performance.com/2004/datetime-datatype
if you do the math 3.33 ms * 299 = 995.67 That leads me to believe that Sybase is using the 3.33 tick whereas SQL Server is using 1/300 ticks
Does that make sense?
 
2:52 PM
God Oracle I just need some client tools why do you need my email. Also why does your effing website not work!
 
Because oracle
 
@ypercube CARA doesn't mean anything in Hungarian
 
cara means face in Spanish
 
CARA means you can't spell in english
 
cara is a girl's name as well
 
3:02 PM
not in Hungary
 
Correct. Only in Gluttony.
 
Spammers are exhausting.
 
@PaulWhite ineed.
 
59 mins ago, by Lamak
@ypercube CARA means face in spanish
:-)
 
@Lamak ha. i didn't scroll up to see that.
For some reason there is not enough coffee on earth this morning to make me feel awake. I hope I haven't built up a tolerance.
 
3:13 PM
@Erik Not really. 3.33 * 29 = 96.57
which would have to be rounded to 97
 
translate: cara
(from Spanish) face
Sweet.
 
but 3.333333... * 29 = 96.6666....
which rounded down is 96, rounded up is 97
 
@ypercube yes 3.33 * 29 is rounded to 97 but 3.33 * 299 is rounded to 996
 
@PaulWhite Did that just translate for you when you do 'translate: <word>'?
 
Hm, which is easier to implement, I wonder, translate: ... or calculate: ...?
Or is there a calculate: thing already?
calculate: 2*3
nope
 
3:16 PM
@MarkSinkinson Yes it's a bot.
 
 
@PaulWhite cool!
 
Mod-only unfortunately. Was abused, apparently.
 
@ypercube the rounding diff between Sybase and SQL Server could be explained by Sybase using 3.33 ms and SQL Server using 1/300 ticks
 
@PaulWhite Do you know which languages it's supporting?
 
3:19 PM
@Erik I feel I am missing some context for that. Too tired from spam-bashing to scroll up.
@AndriyM Er, I think it's just a layer over Bing translate, so probably no languages well.
 
@Erik how would it explain that 3.33 * 299 shows as .996 ?
 
Mod-only? :(
 
@PaulWhite Cara is a female name and that wiki link was to a famous woman with the name Cara. Fembot is reference to Austin Powers linking the translating bot to the girl's name which was translated. Basically just a lame joke
 
39 mins ago, by Erik
if you do the math 3.33 ms * 299 = 995.67 That leads me to believe that Sybase is using the 3.33 tick whereas SQL Server is using 1/300 ticks
Erik meant 3.33 literally, not 3.33333...
 
@AndriyM I know.
I mean: How 995.67 becomes 996 ?
 
3:23 PM
@Erik Ah thanks. I'm not up to speed with my Austin Powers.
 
Rounding up (nearest integer)
 
How 996 babby formed?
 
@AndriyM And then, how 3.33 * 2 = 6.66 would be rounded to 6 (and not 7)?
 
@PaulWhite It is probably better that way. :)
 
(Assuming that Sybase always shows 0, 3 and 6 as the ending digits of time values?)
 
3:25 PM
^^ Lol the just put her in jail I love it.
 
Passed 5K!
2
 
JNK
@Zane I don't, that's what she wants
to be a martyr
They should have imposed a fine equal to her salary
 
@Zane Wow!
 
@ypercube valid point. If I was a better mathematician I could compare the number of times rounded up versus down when multiplying by 1/300 vs 3.33. Or following @Lamak 's advice with the dba/backup I would ask the people on Math.SE to figure it out. At the end of the day I think the true answer is: because they wanted to. After all they had the space to store 2ms ticks in the 4 byte time section......
@JNK I agree imprisonment was her goal so she could (try to) restart the battle on religious grounds.
 
> Various 2016 Republican presidential candidates, like Mike Huckabee, Louisiana Governor Bobby Jindal, Senator Ted Cruz and Senator Marco Rubio, have come out in support of Ms Davis' decisions.
Ha.
Goodness me, you'd think they'd be able to reach a compromise where she could just get the problematic licences issued by one of her deputies. I presume her job consists of more than just issuing marriage licences too.
 
3:43 PM
@ypercube for you
0
Q: using where clause causes invalid column name error

mHelpMeI am using SQL Server 2012. I have written the query below which works fine apart from when I include the last line 'where NomDiff <> 0'. It tells me NomDiff is an invalid column name. I don't understand why and don't know how to get the query to return only rows where the nomDiff is not equal ...

 
@PaulWhite The judge suggested that she let her deputies issues the licenses she was uncomfortable with. She refused.
 
@JNK Indeed it is but she's on the wrong side of history and public opinion is so completely on the other side of this issue that the more front and center it is the better.
@PaulWhite Yeah. A bunch of "Limited Government" Conservatives who seem to think government has a huge role in the bedroom.
 
@mmarie What a muppet. (Her, not the judge).
@Zane Indeed.
 
@Lamak Three answers almost simultaneously.
And no-one has suggested APPLY so far
 
@AndriyM yup, lately I don't really answer questions, mostly post comments
 
3:48 PM
@Lamak Same here.
 
actually another user asked me why I had decided to post a comment with a solution and leave the question unanswered instead of answering the question
I didn't want to actually say: "because it's a damn trivial question that I don't want to give a proper answer to, and rather see it closed"
so I said that it was because I was using the android app
 
Did the question stay unanswered long?
 
@ypercube thanks for the link in the comment. I think it really adds a lot. I didn't see it before
 
This person is frustrating
Right.. but SSRS doesnt support ad hoc queries, dont know about tableau , my point was, since SSAS allows me to specify a pages axis (as an example), is there a tool that will show the output in a way that the pages axis actually appears on different pages? But one where I write ad hoc queries and dont actually design reports — Akash 51 mins ago
 
3:51 PM
@PaulWhite yup
@AndriyM nope, and that was actually part of my reply
 
Cool.
 
"I want to see the data in a certain way, but I don't want to design the visualization. "
 
@Lamak, not sure what stopped you from posting that as answer instead a comment and keeping the question open in turn. — Rahul 22 hours ago
@Rahul I'm using the android app and it's quite the PITA to post code there. So I posted the comment since there will be no doubt a lot of people that will actually post the answer — Lamak 22 hours ago
 
@AndriyM Did you want to post the APPLY answer?
 
@MarkSinkinson Nope. Feel free if you'd like to.
 
JNK
3:53 PM
@MarkSinkinson yikes just use cross apply
I hate seeing people with like correlated subqueries for that stuff
 
Moar CTEs!!!
 
JNK
yeah or CTEs
They need to be more....Common.
(•_•) ( •_•)>⌐■-■ (⌐■_■)
 
Nice.
 
ah, "sense of humor"
 
@JNK I would always use cross apply :)
 
4:00 PM
2
A: using where clause causes invalid column name error

Mark SinkinsonUsing APPLY VALUES is a good way of not having to use a subquery, or another CTE: WITH pf AS ( SELECT Name , Sedol , Nominal FROM tblTempPLF WHERE FundCode = 'CSGE' ), pc AS ( SELECT Name , Sedol , Nominal FROM tblTempPCF WHERE F...

^ Evidence ^
 
@MarkSinkinson You can also replace the same expression in the SELECT clause.
 
Always a bit worrying when I see basic SQL questions being asked by people messing around with financial instruments.
 
AS before column aliases would probably add to readability too, if the Alias = Expr style doesn't quite cut it. (Although I'd go for the latter.)
 
We're turning into Code Review :)
 
dba.stackexchange.com/q/111528/72091 does that question qualify for chameleon based on the last couple of edits? It started as how can this be done and morphed into match my json with a schema....
 
4:05 PM
@PaulWhite We are improving an answer, I don't see a problem :)
 
@AndriyM Neither do I. Just making a topical observation.
14
Q: Which site is best for code reviews of queries?

PhrancisImagine a junior database developer / DBA that may not have an avenue to get their SQL code reviewed for best practices and such as they are learning the ropes. There is of course the Code Review Stack Exchange (CR.SE) site, which can and will review SQL if it is posted and falls within the site ...

 
@PaulWhite Is it wrong that my worry tends to increase the closer they are to my/my family's/my friend's money?
 
@Erik I don't think so :)
@Erik A bit, but I'm not going to do anything about it because the original question was terrible. It's probably in the best shape it's been right now.
The only answer there is paying the price for answering an unclear question.
 
@PaulWhite lol, fair enough
 
@Erik I almost closed it originally, but left a comment asking him to clarify instead, which he has now done, to his credit.
@AndriyM Like this?
 
4:19 PM
Anyone around know a bit about XQuery + SQL Server?
 
@MikaelEriksson ^^^
 
@PaulWhite Yes, saw your edits. Don't know why I didn't think of editing the answer myself.
 
@Phrancis Would it make a good question on Database Administrators?
 
... potentially I guess, worth a try
It might be a little bit too basic though
 
MikaelEriksson needs the rep :)
@Phrancis If it's truly basic, consider Stack Overflow instead.
 
4:24 PM
OK, but I'm letting you know ahead of time, I'm having an issue with syntax error
 
Sure. Go on.
 
Hm, maybe I should RTFM on MSDN first
 
Is it possible to express the bones of it here without posting a wall o'code?
I hate XQuery myself, but Mikael is a wiz.
 
I'm not a wiz, but at least I don't hate it.
 
@AndriyM You enjoy XQuery?
 
4:27 PM
@PaulWhite I think I do. Not very often. Which is probably just as well.
As a developer, I find it interesting to play with.
 
declare @cam table (
    id int identity,
    cam_xml XML
);
insert into @cam(cam_xml)
    select'<order-request xmlns="REDACTED" server-name="REDACTED" database-name="REDACTED">
              <supply-order id="276502" />
            </order-request>';

select *
from @cam
  cross apply cam_xml.nodes('/order-request') as t(c)
where c.value('(supply-order/)[@id]', 'int') = 276502
--XQuery [CustomerAppMessages.cam_xml.value()]: Syntax error near ')', expected a step expression.
^^ this is the whole sum of the problem
 
1
Q: XQuery [nodes()]: Syntax error near '<eof>', expected a step expression

JohnLBevanRunning the below SQL/XPath query returns the following error: Query: ;WITH XMLNAMESPACES ( 'http://schemas.microsoft.com/win/2004/08/events/event' as ns , default 'http://schemas.microsoft.com/win/2004/08/events/event' ) select [Events].[Event].value('(./System/TimeCreated/@SystemTime)[1]',...

Possibly the / in supply-order/ throws it.
 
oh, come on, that was way too fast
 
Well I got a different error now, so that's a start :D
 
@Erik Hi. Have you worked with Xamarin/Mono?
 
4:37 PM
5
A: Can I use attribute name to identify XML element?

wBobThe .value method must always return a single value so you normally wrap it in brackets and move the ordinal ( eg [1] ) to the end. Here's an example: DECLARE @xml AS XML = '<DATA> <ROW RowNumber="1"> <COLUMN Name="ProdID" Value="1234" /> <COLUMN Name="AppID" Value="20144" /> <COL...

I think that's just what I needed
 
Yes, it's supply-order[1]/@id instead of (supply-order/)[@id]. And the only problem that remains now is your use of * in SELECT. You can't select * when you have .nodes() in your APPLYs. Need to specify columns explicitly
 
@Phrancis If was about to ask the same thing: which columns to do want to return?
 
@MDCCL nope. I want to try it out but I haven't found the need yet.
@PaulWhite if you save a person you are responsible for them for life :) dba.stackexchange.com/q/114225/72091
 
@Erik I'm in the same situation, but I was wondering if someone reliable like you already had experience with it. Looks definitely interesting.
 
4:53 PM
@MDCCL I've heard good and bad. I think this is the direction Microsoft wants to go, so I'm sure we will see more of it in the coming years.
 
So, still having problems ... I'm starting to hate XQuery too :D
 
@Phrancis I was mistaken, the * wasn't the last issue. For some reason I can't get any rows. Still not hating it, though :)
 
I'm having the same problem
declare @cam table (
    id int,
    cam_xml xml
);
insert into @cam(id, cam_xml)
    select 1, '<order-request xmlns="REDACTED" server-name="REDACTED" database-name="REDACTED">
              <supply-order id="276502" />
            </order-request>';

select id, cam_xml
    --,[ServerName] = ord.c.value('@server-name', 'varchar(50)')
from @cam
  cross apply cam_xml.nodes('order-request') as ord(c)
where ord.c.value('(supply-order/@id)[1]', 'int') = 276502
Something is wrong with that cross apply methinks. Scouring SO right now
 
@Phrancis Why don't you ask the question formally on dba.se?
 
OK, let me do that, then
 
5:05 PM
@PaulWhite sparse columns. that sounds fascinating
 
@Erik @Phrancis Seems too basic, even though we can't figure it out. If it was me, I'd probably post it on SO.
Ah, here's @Mikael!
 
I felt a disturbance in the force. A million people crying over XML.
5
 
@MikaelEriksson Could you take a look at the latest snippet above, please? For some reason the query doesn't return rows.
@MikaelEriksson That's exactly what it was :)
(like)
 
@AndriyM Makes sense. I figured since you guys were having some trouble we might as well engage the wider interwebs.
 
@Erik Yes, that seems to be the trend. Hopefully it will become more stable before we need to use it.
 
5:09 PM
with xmlnamespaces(default 'REDACTED')
select id, cam_xml
    --,[ServerName] = ord.c.value('@server-name', 'varchar(50)')
from @cam
  cross apply cam_xml.nodes('order-request') as ord(c)
where ord.c.value('(supply-order/@id)[1]', 'int') = 276502
 
@MDCCL Isn't that always the dream.....
 
with xmlnamespaces was the answer then
@MikaelEriksson Thanks!
 
This part xmlns="REDACTED" defines a default namespace.
 
cursed namespaces
@MikaelEriksson are you doing pass summit again this year?
 
That may be the reason many people hate XQuery. Would probably be a decent reason for me to start hating it too.
 
5:12 PM
@swasheck Yep, sure is.
 
I'm also really not enjoying shredding XML in SQL Server today
Have 20 GB of extended event session data to shred and it's taking over a day
 
@JamesLupolt is everyone parsing xml?
 
I'm probably doing it wrong
 
@JamesLupolt yeah. at that scale i'd go with c#
or python or something
 
Haha
I saw that edit!
 
5:14 PM
yeah. i realized it'd take you 30 minutes to write some perl code that does nothing that you want it to do
(s/you/me)
 
@JamesLupolt make sure you put it in a xml variable or a table with an xml column before shredding. Casting to XML in the same query as you are shredding would kill performence.
3
 
declare @path varchar(255) = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Log\*.xel'
select object_name,file_name = reverse(left(reverse(file_name),charindex('\',reverse(file_name))-1)),event_data = cast(event_data as xml)
into #stage
from sys.fn_xe_file_target_read_file(
	@path,
	null,
	null,
	null)
that's what i'm currently doing
 
@MikaelEriksson Holy crap, that's all it was...
Thanks so much!
 
refreshing my XE session for Portland
2% internals knowledge
98% xquery guessing
100% frustrating
 
@MikaelEriksson What's the significance of the p1 in the output of:
WITH XMLNAMESPACES (DEFAULT 'REDACTED')
SELECT t.c.query('.')
FROM @cam AS c
CROSS APPLY c.cam_xml.nodes('./order-request/supply-order[@id="276502"]') as t(c);
i.e.
<p1:supply-order xmlns:p1="REDACTED" id="276502" />
 
5:21 PM
It is a alias for the namespace.
you can have more than one namespace but only one can be the default.
 
shorthand for P_O_S__NAMESPACE
 
@MikaelEriksson Right, but why p1 in particular?
I didn't ask for an alias.
It's this sort of weird poorly-documented #$%^ that makes me hate XQuery.
Not to mention the xmlns as an attribute thing.
 
.query() creates an entirely new XML and since there was a namespace used you got one there as well. The alias p1 could really be anything, I guess MS decided to start with p1 and continue with p2 if needed and so on.
I don' think query(.) will ever create a default namespace unless you ask for it.
Perhaps not entirely true.
 
@MikaelEriksson Yep that's what I'm doing (based on some code I modified from @swasheck and Kendra Little). Any other general tips?
 
oh crap. if you're using my code, you're screwed
 
5:33 PM
@PaulWhite Am I at all addressing what you wanted to know really?
 
I'll let you know. Am busy for a sec.
 
hellbanning users, apparently
 
@JamesLupolt With large XML, if possible, it is better to pre-shred to a temp table and then shred the many rows with smaller XML than doing the entire XML at once.
 
@MikaelEriksson Yes, totally. So it's not standard? It's an MS thing?
 
5:39 PM
As far as I know, yes. And when you query the XML you of course don't have to care about what alias was actually used in the XML you can define your own alias in the query and it will work just fine.
 
@JamesLupolt are you parsing one huge xel file or multiple smaller ones? are they all hitting the max size?
 
@MikaelEriksson Thanks. That explains it nicely.
 
@swasheck They're 256 MB each. But I'm loading all of the events from all files into a temp table. That's the fairly fast part (1 hour). The slow part is pulling the information out of the events that I want into another temp table.
Can you access gist or pastebin? I don't want to code-spam the room.
 
sure
gist
not pastebin
 
5:46 PM
plus we could get @MikaelEriksson to help
 
If he really wants, I don't really expect Code Review as a Service in a chat room.
 
@JamesLupolt first thing i'd do would be to change this
INSERT #TraceDataXML (event_data)
SELECT
  x.event_data
FROM  sys.fn_xe_file_target_read_file(@filepath,null,null,null) as xet
to
INSERT #TraceDataXML (event_data)
SELECT
  event_name = object_name,
  file_name = reverse(left(reverse(file_name),charindex('\',reverse(file_name))-1)),
  x.event_data
FROM  sys.fn_xe_file_target_read_file(@filepath,null,null,null) as xet
that way you dont have to extract the event name from the xml (not that big of a deal)
and i've also begun capturing system_health over time so i like having the file such that i dont reload stuff
 
yeah
i've been loading system health from all the servers into a central database every day
only the events i'm interested in though
 
also ... have you discovered this CROSS APPLY (SELECT CAST(event_data AS XML) AS event_data) as x to be faster than
SELECT
cast(event_data as xml)
FROM sys.fn_xe_file_target_read_file(@filepath,null,null,null) as xet
?
in "slow part" you're recasting xml as xml
shouldnt
 
well that doesn't sound like useful work then
i'll test cleaning that up
 
5:53 PM
@JamesLupolt even fastpart could be faster
you've got a cross apply and an outer apply when it looks like you could just cast(event_data as xml)
 
@JamesLupolt Wouldn't this make a useful question on main?
 
to be honest... i don't remember how the code got this way.
 
I can't believe you're the first person to face this sort of issue.
 
@PaulWhite Probably, it's almost been enough for me to consider downgrading to using SQL trace providers.
 
5:55 PM
do you want the nodes that don't match //event ?
 
@swasheck I can't remember. You've given me some useful things to consider. I think I'll clean it up, test it, and then maybe ask a question on the site for further advice.
 
flabulous
 
@JamesLupolt Confession: I still use trace for most tasks.
 
@PaulWhite smart man
i like the stats XEs though
they make me all tingly
 
Thanks all
 
5:57 PM
@JamesLupolt ... error in FASTPART that i just changed
 
I'll revise the the code to the point where I can ask a question that couldn't be reasonably answered with 'your code is crap and you don't even know why it's written the way it is.' Then I'll post something on the site soonish.
 
6:15 PM
$ BODY $ should be $BODY$a_horse_with_no_name 2 mins ago
It's that time of day again.
 
6:46 PM
I'm not sure basic syntax falls into this diagram.
 
@JamesLupolt nobody said your code is crap
 
But it is :)
 
then my code is crap because you said you used it
 
@JamesLupolt Questions don't have to be perfect - just look around :)
 
@PaulWhite questions need to be decent. code can be crap.
 
6:59 PM
Sure. Most production code is crap.
The world continues to spin.
 
the sun rises in the east
and @swasheck says dumb things
all of these are universal truths
 
Apparently not:
7
A: Statistics disappear after incremental update

swasheckNot sure if it's a bug, per se but it's definitely an interesting occurrence. Online partition rebuilds are new in SQL Server 2014 so there may be some internals to sort through with this. Here's my best explanation for you. Incremental statistics absolutely require that all partitions be sampl...

 
i'm updating at your behest
 
I've always said you're a good man.
 
i've never heard you say that :)
 
7:03 PM
I say it quietly, from a long way away.
 
perfect
dont want it to go to my head
 
7:14 PM
@swasheck at least he called you a good man. IIRC he called me good "egg" instead
 
7:30 PM
Any of our Oracle Nerds in here?
 
haters gonna hate hate hate hate hate
 
I always forget who the Oracle people are.
 
jackdouglas, phil, can't remember who else
 
7:59 PM
Wow, that XQuery actually worked against the real database too. Nice.
 
8:24 PM
It's cool I figured it out.
What an odd country we live in.
Scratch that "I live in"
 
I hear ya
I'm in KY so plenty of weirdness around here too
 
02:00 - 21:0021:00 - 23:00

« first day (1704 days earlier)      last day (3164 days later) »