« first day (5084 days earlier)      last day (51 days later) » 

00:50
make sure no one else drinks it
yeah nah just watching it won't help, did he have biceps and knuckles to go with that?
apparently not
 
2 hours later…
02:35
@ErikReasonableRatesDarling that's a cool idea.
"you done messed up, A-A-ron."
03:38
Bitcoin hitting $100k USD makes me wonder who's holding the bag.
 
2 hours later…
05:50
@ErikReasonableRatesDarling One tries not to offer poor advice
 
4 hours later…
 
4 hours later…
13:32
60 minutes
who has time for that
i hope they paid those kenyans $2 for their hour
That's the name of the show. The video is ~13m
@ErikReasonableRatesDarling spoiler - they didn't
i am familiar with the show
it has been on since before i was born
14:18
@SeanGallardy It's probably an edge case, but that said, who knows how many people are experiencing log rushes like this while not having the skills to trace it back to query store. It does make sense to run the DBCC reorg on internal tables after cleanup completes, since the user can't do that.
1
Q: Huge log backups due to enabling querystore

Frederik VanderhaegenWe have a SQL Server 2019 CU18 where we discovered a strange issue with querystore. Normally the average size of the hourly logbackup is 40MB but as soon as we enable querystore the average size of the logbackup is 2.5GB. There are (according to querystore) 140.000 queries executed/hour. This is ...

For context
I didn't add it because everyone currently active has done something on the Q & A recently
Wordle 1,265 4/6*

⬛⬛🟨⬛🟨
⬛🟨⬛🟨⬛
⬛🟨⬛🟩🟨
🟩🟩🟩🟩🟩
I'm a little surprised they're not using a custom capture policy on 2019
AUTO gives SQL Server heaps of latitude to do mysterious things
@PaulWhite That's where it seems the data is leading, I just don't work enough with QS to definitively say one way or another. My overall reasoning for saying what I said about "how the log works" is that the OP seems to believe you can enable QS and there be no log impact when data is saved to the database and subsequently removed.
14:24
@PaulWhite I've never used custom capture policy
@SeanGallardy I've just been running it with a debugger attached. That is what happens for me
I'm excited for your results, you always do a bang up job at writeups
I'm technically OOF until Jan 2nd
It ends up calling into sqllang!CQDSHost::ReorganizeIndexesForQDSInternalTables
@SeanGallardy On OnlyFans?
3
@Zikato Out Of Facility (time off, vacation, pto, whatever czechs out)
14:27
i thought it was out of fucks
2
I'll stick with my definition, thank you very much
@ErikReasonableRatesDarling Legit this as well.
facility makes no sense when you work from home
It's interesting QS prefers to do time-based cleanup first, whatever the trigger was. Presumably, that's the more efficient method.
you're not a janitor (yet)
14:27
@ErikReasonableRatesDarling That's how I read it
this would all be solved with non-logged tables
@PaulWhite ha, so it's not once a day?
@Zikato Seems not. Well, the trigger is once per day, but any trigger might end up doing the time based thing.
Perhaps it would be more accurate to say it runs at least once a day
The only thing I'm really uncertain about at this point is why cleanup is triggering at all for the OP
The code is nicely organized and obviously designed not to get too much in the way (as a background task shouldn't), but it's a bit of a bugger to trace through
There's a state machine that sort of retriggers itself every five seconds to continue with the next stage of the task
14:31
rabbits
and then remove or edit that message please :)
@SeanGallardy On 2019?
Nah, 2022+
> We have a SQL Server 2019 CU18
So it'll be 15 years before they upgrade
Yes, I asked because I'm repro'ing on 2019 for the OP
Makes sense, I was only glancing at what's there now
Wouldn't a flag in that area be specific to secondaries?
14:35
Wordle 1,265 6/6*

⬛⬛⬛⬛🟨
⬛⬛🟨⬛⬛
⬛🟨⬛⬛⬛
🟨⬛🟨🟨⬛
🟩🟩🟩⬛⬛
🟩🟩🟩🟩🟩
But thanks, I'll make a note to look into that on 2022 l8r
Oh yes, Wordle
Wordle 1,265 4/6*

⬛⬛🟨⬛⬛
🟩⬛⬛⬛⬛
🟩🟨⬛⬛⬛
🟩🟩🟩🟩🟩
That's a tiny fan
Wordle 1,265 3/6

⬜⬜⬜🟨🟨
⬜🟩🟩🟨⬜
🟩🟩🟩🟩🟩
@PaulWhite No, it's specific to QS (items in that range)
14:43
Beaten by a EFLer!
@SeanGallardy Yeah, I mean QDS for secondaries
Nope, not specific to secondaries
e.g. Query Store Secondary Notify Forcing Change On Hot Failover one below it
Ok!
I can't help but notice that TF has no 4
@PaulWhite Look at the total range though, some are for secondaries, most are just QDS generic
Yep, fair enough
It is quite the problem with no 4's
14:48
Plastic trace flag
imposters really
2019 doesn't have anything to control it and it seems the flexibility was expanded in 2022
My last hope is that expanding STALE_QUERY_THRESHOLD_DAYS will address his premature triggering problem.
They make pills for that
I have had no luck getting the XE query_store_capture_threshold_changed_feedback_loop or its friend to fire. I don't suppose it's directly related, but you never know with an OP
query store really is tricky
i'd rather have it than not, but anyone who's all sunshine about it is dense at best
14:58
I assume it's set for AUTO and size based retention? If so it should fire :/
@ErikReasonableRatesDarling the Erik Epoch being a notable reference standard
I remember when QS first came out, the number of support calls we had for it was crazy. It's since been a very low generator (after 2019 came out) and I haven't seen much for 2022, granted I moved teams by that point.
why because everyone turned it off
Well, the drama with spinlocks and such wasn't so long ago
We won't be talking about preview features, I suppose
15:02
True, that was another edge case also
i remember the cmemthread problems too
didn't take much
I guess nothing is for free. Everything comes with its trade-offs. Even RCSI 🤣
Capturing and aggregating all those stats and plans, it's a wonder there weren't more problems
QS plan forcing has also not been entirely issue-free
@PaulWhite moral hazards
3
One curiosity is the more relational format of QS vs plan cache makes deletion much more tricky
There was a recent issue with contained AGs and the plan cache as well
15:06
Sounds like an AG issue tbf
It was actually a plan cache issue
Still sounds like an AG issue
Change of database id wasn't it?
@Forrest underated rimshot
15:09
I smiled slightly!
Not fully because I'm a bit grumpy they sold QS plan forcing as if it were some completely new implementation, rather than reusing the existing plan guide core
@PaulWhite Pretty much
How the heck is it Friday already
15:45
make the man an old spanish
Seen on the interwebs today -
harsh!
@PaulWhite Harsh or shitpost of the day? You decide.
why-not-both.gif
16:08
kinda makes too soon seem tardy
16:38
I'm feeling fairly pleased with myself this morning. Just rewrote a Powershell script that I use to import rows from a set of very big text files into a database. The previous version was doing RBAR INSERT INTO ... statements for every row in the source text file. I added batching via a table type and a .Net DataTable, with a variable batch size, and the rows-per-second went from ~300 to ~25000 per second.
why not bcp?
sorry - not to undercut your joy
17:04
Captain Actually over here.
4
Raining on parades.
at your service 🫡
@PeterVandivier there are over a thousand files, and its a strange format that I need to parse carefully.
fair enough
consider your parade moist
I considered just writing a console app in .Net but then I wanted to hone my Powershell skillz too
i can respect that
17:08
the files are TLD zone files from ICANN, in case anyone is interested. I'm intent on doing some fairly silly research on domain names.
your.mom is interested
you could parse and write them to normalized text files and then use bcp
or just use duckdb
yeah I could probably not even use SQL Server at all. But, you know, use the tools you know.
like duckdb, for example
😝
I could undoubtedly make it run faster by making all kinds of tweaks. For instance, the database is part of a Distributed Availability Group. The table has a clustered index, an identity column, and a non-clustered index. The database is stored on a rather slow direct-attached RAID 10 array of 7200rpm disks used for a lot of different things. The network is only gigabit. etc.
it's just a side project
17:29
load it into tempdb
them into the user database
extra credit!
17:50
you already 10x'd performance
i don't think there's any more x's after that
100x lol
although maybe room for some apostrophes
just by modifying the amount of time spent in observer effect I'm now getting 69k rows per second.
nice
420k would be pleasingly close to 100x
you have your next target
you could get that with duckdb
17:55
🦆
I could probably get a million rps with MangoDB
eventually
🦆🍆💥
explode that duck
there are over 66 million rows in the table so far and we're only on the .com tld, and only at attempt-settings.com. Seems like this table might be quite big by the time it's done.
what exactly are you trying to do
just setting up to do some light analysis on Internet domain names, name servers, zone signing, etc.
18:02
so what you're like getting every domain and pinging it
or tracert
actually I downloaded the zone files directly from ICANN for every TLD in existence (aside from several that don't allow you to download them, such as .ca and some very weird Chinese ones).
so I'm ingesting the zone files into a database to do analysis
The AG in async mode didn't have any log send or redo queue. So why was there a freeze for 5 minutes? Can you give some logical explanation. No where does document say that entire applications will be halted for 5+ minutes upon mode change to sync. Infact there is a session timeout of 10 seconds which will auto change mode to async if there is significant delay in commits. So I request you to give logical answer rather than quoting links to full length documentations. — variable 2 hours ago
what a disk
oh variable
18:17
hey hey ho ho this variable question has got to go
i wonder how on earth they expect anyone to know why their piece of crap ag choked up for five minutes based on the provided information
oh here's a detailed analysis of fuck all
pretty much
one wonders how Sean will feel about continuing to answer their questions.
same old song and dance
Does sound like an AG problem
A synchronous one at that
you upvoted that didn't you 😋
and now people are downvoting Seans answer. What a world we live in.
19:12
poor sean
good thing he's oofs i guess
Good morning.
Do any of you have an experience with SSMS Boost plugin? How does it compare to SQL Prompt? I got SSMS Boost at my current workplace and I feel like I would prefer SQL Prompt instead. Is it just me being unable to use it efficiently, or is just somewhat worse?
Some big earthquakes off the California coast
That certainly seems like a tsunami recipe
19:44
@PaulWhite at least it's polite enough to wave goodbye
🤣
🌊
👋🏻
@ErikReasonableRatesDarling Not even their AG, their "application"
@HannahVernon I stopped answering them for a while, they never mark an answer and only make comments asking for me to do their job :/
I'll go back to not answering them
thanks @HannahVernon
20:07
Tsunami warning cancelled
20:17
Is it now a tsunami certainty
I wonder how many people actually evacuated
We get over-eager warnings as well. No one wants to be SUED
Seems California went back to async
After a 5 minute delay
More like A STINK
🥁
🥸
The wave has been waived
Rolled back if you will
I wonder if I should bother commenting on this sqlundercover.com/2024/12/04/…
20:49
Only under cover
it's quite annoying when you rewrite a query to do more sensible things and you start getting a serial plan that's 2x slower
I just got dumber
3
Thanks for the link
@ErikReasonableRatesDarling But you're in a much better position to start making improvements 🎉
i would really just like forget about it
this is abusive
21:07
@ErikReasonableRatesDarling We recently started monitoring these, and if we detect queries with more than hundred values in the IN () list, we will create ticket asking devs to rewrite their shit. They don't seem to appreciate how cool that is, though.
how are they generating the in clauses
Sadly, don't know. But for some reason they want to iterate over hundreds of Ids. One would naturally assume, they care about some particular attributes of the entities, and not some imaginary identifiers.
I probably should have asked.
21:25
@SeanGallardy my pleasure
@PaulWhite thanks for the warning
@Yano_of_Queenscastle if they're using an orm, the alternatives aren't great
Well, the alternative is for them to not use ORM, at least for these queries.
Of course, much easier for them is to rewrite the query with long IN() into several with relatively shorter INs - which is something I am sure is happening.
21:46
my TLD ingester is now working on the .com tld on domain names starting with b and we're already over 92 million rows.
I dropped the clustered index, and the non-clustered index, and the primary key constraint, and am inserting into the table using the TABLOCKX hint, and it's going pretty quickly, but wow is that going to be a big table lol.
I'm using DBCC PAGE in concert with sys.dm_db_database_page_allocations undocumented DMV to see where its at since my ingester doesn't show anything aside from the number of rows it has ingested.
let me know when you get to my website
should be soon lol
it just did decesosbaratos.com
22:02
did you get beergutmagazine
before I run this again, I'll have it report the domain name it is working on along with the row number. It currently only shows the number of rows it has consumed once per batch.
H building the world's slowest DNS
@ErikReasonableRatesDarling good question. It'll be hard to tell without any index and an exclusive lock on the table lol
Unless you're doing parallel bulk load, dropping the clustered index was probably a mistake
@PaulWhite there are such a surprising number of domains that are just parked doing nothing.
@PaulWhite I feel that.
22:05
I wonder when you'll decide on column store
we're at 122 million rows now so it is motoring along nicely
@PaulWhite perhaps someone should take bets
@ErikReasonableRatesDarling That's a familiar and horrible pattern. Added in 2012 I think.
I've been known to disable that transform by name
Not something I do lightly
what makes you say it was probably a mistake to remove the clustered index unless I am doing parallel bulk load?
its a staging table that I'm truncating before each run
Well, I think you said it had a clustered index and a non clustered index originally. Bulk minimally logged load to a clustered index is possible. Parallel loads are tricky
Loading to a heap is fine too, but counterproductive if you are going to recreate the clustered index
yeah I've been of two minds about dropping a clustered index only to recreate it afterwards. Does seem counterproductive.
22:19
Back in the Stone Age, loading a clustered table wasn't possible with bulk load and minimal logging
I'm doing an insert into the table 50,000 rows at a time right now via:
INSERT INTO [dbo].[tld_raw] WITH (TABLOCKX)
(
      [p1]
    , [p2]
    , [p3]
    , [p4]
    , [p5]
)
SELECT
      [tr].[p1]
    , [tr].[p2]
    , [tr].[p3]
    , [tr].[p4]
    , [tr].[p5]
FROM
    @data_table [tr];
The @data_table is a custom type that I populate using a .Net DataTable
excuse the leading commas of course
I should have switched them before posting here - don't want to make your head explode more often than is strictly necessary
@PaulWhite what is it named
i'd like to pay a gypsy to curse it
Don't recall the name now. Mobile
Good Lord an insert select from a table variable with no ordering guarantee and guessed cardinality
Enjoy the heap load
22:35
@PaulWhite yeah I love that the plan expects 64 rows to be inserted
it's at henrystreetdeli.com now
there was a henry street deli by me when i lived on henry street in chinatown
apparently they missed their .com opportunity
Maybe they have a .cn web address
interestingly the .top TLD is the 4th largest zone (by zone-file-size, at least).
I can't even think of a single .top domain name
22:55
Good job you have a handy list
yourmomison.top ?
microsoft.men.top
Are standing by
or men.microsoft.top for a little rpn action
Was trying to avoid a lawsuit
23:02
What's the fun in that, just ask HR about my file
Jack missed out on answers.top
sqlserver.gold is not taken
$10 for the first year, then only $149 thereafter lol
dear god, why so much
It's not actual gold... I can't make cpus out of it
23:11
this this is true
230 million rows ingested
How much is feelin.gold
@ErikReasonableRatesDarling unknown - .com tld zone file is 24GB of text which makes it kind of unwieldy
@PaulWhite $10 for the first year via godaddy - $149 there after. Hover.com has it listed as $122.99
Word Press pricing I see
@ErikReasonableRatesDarling as a rough guess I would think I'm probably one third to one quarter of the way through
23:24
Jeez that’s all
What are you using service broker
just passed the 250 million mark lol
@ErikReasonableRatesDarling clearly
We loaded 24GB of data in only six days ask us how
Power Shell Activate!
the table is consuming 30GB now
I think the MERGE INTO will definitely make SQL Server mad at me.
the table is configured with page compression, btw
although I can feel columnstore compression being in my future
23:31
Gotta meme it, should have partitioned it while using views on top of multiple bulk loads using ssis kicked off by powershell utilizing dacfx
16
Q: Compression on a heap

user99201The follow is a paragraph from Microsoft Docs: New pages allocated in a heap as part of DML operations will not use PAGE compression until the heap is rebuilt. Rebuild the heap by removing and reapplying compression, or by creating and removing a clustered index. I can't figure out why this...

I'll take my prize now
> I can't even think of a single .top domain name
s.top
@PaulWhite I had a sneaking suspicion the PAGE compression was a lie.
I wonder how many things I have forgotten
I think you'll be ok with the table lock actually
But testing it on a partial load to be sure would've been a good idea
Bulk load should also apply page compression, but it's unclear if you're getting that. Check to see if the table has a Sch-M lock
23:37
it'll either (a) be finished in the morning, or (b) the server will have died.
How's your transaction log looking
lol stupid chat
Jesus what is that mess
If the table has a schema modification lock, you're getting bulk load
that's the locks for the session
Oh well
23:42
the transaction log is good - it keeps being backed up and clearing
@PaulWhite yeah I was surprised to see there is no schema modification lock
I thought a TABLOCKX insert into a heap would do that.
Well, the table isn't empty any more is it
obviously I was wrong
@PaulWhite definitely not
I suppose it might have had a Sch-M lock for the first insert statement
284 million rows now
Oh, it would have been ok non-empty but your estimate is too low sql.kiwi/2019/05/minimal-logging-insert-select-heap
still working on the .com zone. The query I was using to get the most recently allocated page for the table is no longer playing nicely, so I'm not even sure where we are alphabetically
> The insert must be for more than 250 rows.
The total insert data size must be calculated as at least 8 pages.
23:48
and that'll never happen with the fixed estimate of 64 rows in the table variable
That's a weird number by the way, but yes
I was not expecting 64, I was expecting 1. But who knows what lurks in that black box.
I suppose if I passed the data into a stored procedure instead of executing an INSERT INTO directly in Powershell I might get a better chance. At least I could populate a #temp table from the table variable then use that as the source of the INSERT ... SELECT statement.
having said that I suppose I could do that in Powershell too
That's crazy talk
you know me
I do wonder where the 64 row estimate comes from
The optimal approach depends very much on the transformations you need on the raw data file and what final table arrangement you want. Worst case, you'll spend 24h loading the data then discover it's wrong or unworkable and you need to start again. All part of the fun, I suppose
23:55
What do you mean the transaction log is getting backed up
Why isn’t this in simple recovery
@ErikReasonableRatesDarling lol, it's a Distributed AG
don't forget this is just for fun
301 million rows now
God has truly abandoned you
You'd still load it into tempdb or a simple recovery database first
23:56
@ErikReasonableRatesDarling a long time ago my friend
6 hours ago, by Erik Reasonable Rates Darling
load it into tempdb
Did you consider a cursor
I hear RBAR is amazing
hey that's what I started out doing
was getting 300 rows per second
23:57
That's not the worst
right now it is doing 27k rows per second
Jesus wept
Torturing databases for fun
smh
I figure 27k rows per second is not all that bad considering the data is being synchronously committed to 4 instances
I'm going to leave now for my own sanity
everyone always talks about how awful AGs are, but they seem to work pretty well for me. Aside from that one thing with the filestream, @Sean

« first day (5084 days earlier)      last day (51 days later) »