@Zikato What about Olympic Query Tuning? It'd certainly be better than watching effing synchronised [swimming | diving | snowboarding] (note use of regex!), BMX, dressage, artistic swimming, rhythmic gymnastics, breakdancing or whatever stupid sport they're going to introduce next! I can't believe that they have room for 5 cycling events - counting track as only 1 event!
They have keirin (motorcycle pacing!) and no room for cyclocross in the Winter Olympics! The Czechs are good at that, aren't they?
@ypercubeᵀᴹ Nice - my own humble effort is on the way - and not a DISTINCT, CTE or regex in sight! Well, to be fair, I didn't want to annoy His Holiness with a regex!
@ypercubeᵀᴹ - Le Beaujolais Nouveau est arrivé! It's about that time of year :-) But seriously, I've give my own answers to that question! I see you've deleted yours - I was going to put it in as a community wiki - maybe when it's more polished? The fiddles aren't with my answer yet - tried tidying up and messed them up! Should be back up and running shortly!
Busted a gut on these answers - first time I've used GIST indexes - look promising - at least from a performance point of view! I would really appreciate any input you may have - on table design, indexing and/or the query itself! And that goes for any of my fellow Heapers!
Thaks for that - I tried this - I'll tidy it up when I have a moment!
My code is incorrect - it was correct - I'm deleting my answer. Last time I try modifying fiddles while clock-watching for an imminent bus! I'll restore it this evening - with working code!
@ypercubeᵀᴹ "Man" is fine - I use it all the time - "Thanks man...", "Oh man.." - I even use that with women! I've even heard women use it amongst themselves!
Hopefully the code will be back up shortly - I've had to backtrack a bit - ya lives n' ya learns!
@Zikato Disappointment is always a risk. I was disappointed by the leading statement terminator, lack of a statement terminator, and prefixed comma-spaces.
You could possibly improve the question by showing what sort of results you would ideally like to see. You might think it obvious.
I suppose the fundamental issue here is how to associate a particular lock with the statement taking that lock, when the statement (even batch) has completed
@Zikato Does you question accurately reflect a typical scenario? Ad-hoc SQL in multiple batches? Or are you more likely to be interested in the T-SQL call stack of the blocking process?
Not that I'm suggesting you would ask an XY question
Leaving aside the question of how to find the blocking information, it seems like @Zikato is looking for a more complete or flexible blocked process report. One way to achieve that is to use an event notification.
CREATE EVENT NOTIFICATION ... ON SERVER FOR BLOCKED_PROCESS_REPORT TO SERVICE ...
We have a very big POSTGRES table containing more than 8 BILLION rows and growing at a very high rate (30 million rows per day).
Our Table is Partitioned on date. Each partition contains 6 months data except the first partition which contains data for almost 18 months.
Postgres version: PostgreS...
In MSSQL server, which recovery model can I use for the Point Of Sale?
In addition, I am working at the company that imports and sells automobile parts (car parts). So there should be a lot of transaction data.
The reason why I am asking this question is that I shrank the database because the sto...
@ErikDarling While interesting, I don't see how to apply this knowledge to my question
@PaulWhite So the idea would be to sent the blocked_process event to service broker, parse the sessionIds and use the sys.dm_tran_locks to find (and store) the locks?
@Zikato Yes, you could skip the built-in feature that guarantees correct behaviour and message delivery in favour of an app running somewhere else using the Power Of JSON
@Zikato No, but in a sense, you have two problems. (1) Customizing and automating what is collected after an interesting blocking event; and (2) Collecting the information you want.
@Zikato Yes, I know. I am employing humour as part of making a broader point.
architecture diagram
I do love a system with complex and non-obvious dependencies. Yes, it's a neat idea, and no doubt well implemented. And comes with an Enterprise Support Agreement.
I'm currently working through getting sqlpackage.exe to understand that certain Service Broker infrastructure already exists, and cannot be created without first dropping the existing item.