Mikael Eriksson

 The Heap™ – Consultancy ©®

General on- and off-site discussion for dba.stackexchange.com....
Jun 26, 2024 06:53
BTW, I have nothing to add to the question about nodes().
https://dba.stackexchange.com/a/340513/2103
Jun 26, 2024 06:51
@ErikDarling The bat-xml-signal still work. You just tag a Q with XML and I will know :).
Apr 3, 2024 14:12
Perhaps easier to get to SQL Bits
Apr 3, 2024 14:11
@ErikDarling New gig and tight purse in that place. Don't think so. Will try though.
Apr 3, 2024 14:10
Yes, still and always has been.
Apr 3, 2024 14:09
Happy to be of service.
Apr 3, 2024 14:06
Hence the quack, I get it :).
Apr 3, 2024 14:05
That works but the inner one is not needed.
Apr 3, 2024 14:04
@ErikDarling Added a bit of explanation to the answer on your XML-thing.
Mar 26, 2024 13:41
The cheese no doubt.
Mar 26, 2024 13:40
Looking it up right now. It's old.
Mar 26, 2024 13:39
Like french cheese. I heard the moon is made of cheese.
Mar 26, 2024 13:02
Ouch, you definitely need some kind of hit.
You could perhaps hire W Ryder as a side kick.
Instant success if you ask me.
Mar 26, 2024 12:57
You should put that in a song and make some real money.
Mar 26, 2024 12:55
There is an ocean in between so he is quite safe.
Mar 26, 2024 12:55
hehe
Mar 26, 2024 12:53
I keep my self up to date with whatever Erik is up to :).
Mar 26, 2024 12:53
The latest one
Mar 26, 2024 12:53
@Z
Mar 26, 2024 12:51
It's big it takes time no one knows where or why or what to do about it.
Mar 26, 2024 12:51
It was ealy on :).
Mar 26, 2024 12:51
You described a query that just sounded like a big xquery thing.
Mar 26, 2024 12:50
@ErikDarling Just listened to you and Joe on youtube.
Mar 26, 2024 12:49
I'm here to learn. Just because I have not seen it does not mean there is something.
Mar 26, 2024 12:49
It was someone I'm sure.
Nov 7, 2022 14:41
BTW, your update to the code getting multiple sqlhandle is superior to any hack answer you got on your question :).
Nov 7, 2022 14:32
@ErikDarling When I looked at this last it was in sp_humanevents and that gets the XML from sys.dm_xe_database_session_targets, one big chunk of xml in one column and one row as nvarchar(max). The @target_type = 'event_file' in sp_HumanEventsBlockViewer` uses sys.fn_xe_file_target_read_file and I think that one always returned one row for each event. I might be wrong.
Feb 25, 2022 21:00
Thx
Feb 24, 2022 16:09
@AndriyM be safe.
5
Jan 28, 2022 06:26
Sadly, it is the number one advice on the internet on how to fix such issue.
Jan 28, 2022 06:18
They where doing a count(distinct) on a left outer join column and the issue they tried to fix with ansi_warnings is that the client code does not do well with warnings.
Jan 28, 2022 06:14
There it is "The optimizer ignores an index on a computed column for any SELECT statement executed by a connection that does not have these same option settings."
Jan 28, 2022 06:13
It works with 176 and persisted.
Jan 28, 2022 06:13
It does early expansion and the does not come back from that.
Jan 28, 2022 06:12
create table T
(
  C1 varchar(10) not null,
  C2 as C1+'1', --persisted,
  index IX_T_C2 nonclustered (C2)
);

go

set ansi_warnings off;

select count(*)
from T with (index(IX_T_C2))
where C2 = ''
--option (querytraceon 176);

set ansi_warnings on;

select count(*)
from T
where C2 = '';
Jan 28, 2022 06:12
Perhaps, I found ansi_warnings needs to be on to be able to create the index. Don't think I have seen anything about it being used.
Jan 28, 2022 06:09
Hi, @PaulWhite Just read your excellent blog post on computed columns.
https://sqlperformance.com/2017/05/sql-plan/properly-persisted-computed-columns
Found an issue in our code where ansi_warnings off caused matching expressions to fail and hinting the index does not produce a plan at all.
I have tried to read up on ansi_warnings but found nothing about that behavior. On the other hand, why bother it should be on.
Just thought it was interesting so perhaps some other do aswell :).
Jan 3, 2022 11:00
Will go JSON as soon as I can.
Jan 3, 2022 10:59
There is no XML in there at all.
Correction there where no XML in there until just resently.
Jan 3, 2022 10:57
I'm at a new gig since a couple of month back. This is where I ended up.
Jan 3, 2022 10:56
Does not feel good at all.
Jan 3, 2022 10:56
Nope, there are rules in SQL Server. Never seen them before.
Apperently you can connect them to user defined datatypes that in turn is connected to columns and parameters and variables.
This is all new to me.
Jan 3, 2022 10:55
@PaulWhite That is a great idea. Will drop out of 2012 support this spring.
Jan 3, 2022 10:54
It's old. Started dev before 7.0 so a lot of rules instead of check constraints and triggers instead of foreign keys.
Jan 3, 2022 10:53
I tend to agree.
Jan 3, 2022 10:53
"Please dear user, you have to be more specific"
Jan 3, 2022 10:52
Bails out of queries with exception if it returns more than 2000 rows.
Jan 3, 2022 10:52
Yes that might be a reason for the queries here. Dynamically generated kitchen sink queries, big table and wide and 26 non clustered indexes.
Jan 3, 2022 10:49
@PaulWhite Thanks, will look into that.
Jan 3, 2022 10:48
In this particular case it is a clustered identity primary key.
All I see is defragmentation and not much benefit at all.
Query pattern is top(x) order by pk desc for most queries.