« first day (2310 days earlier)      last day (2856 days later) » 

00:24
The other day I found myself musing about inter-query parallelisation. Not intra-query that we know and love where the optimizer chooses parallel operators depending on MAXDOP (for the SQL Server world). Instead, I'm talking about inter-statement parallelisation such as "INSERT these rows in this table and while that's happening INSERT those rows in that other table; when they're both finished do this."
Sometimes an overly large query produces a poor plan. Splitting the query then combining the temporary results set is one strategy for getting a better plan. If the part-queries could be executed in parallel run time would be reduced.
Has anyone come across papers, blogs or interwebz chatter on this topic? Or is this just crazy-talk?
01:00
@MichaelGreen I've seen a custom built framework using jobs in sql server which I think did what you're describing
different queries get sent to different sessions and when all of them are done something else happens
 
5 hours later…
06:04
morning
06:40
@MichaelGreen SSIS would do that easily
07:31
161
Q: Brief outage planned for Wed, May 3, 2017 at 8pm US/Eastern (00:00 UTC) (like a fire drill for computers)

Tom LimoncelliMicroVersion: Planned service degradation: All Stack Overflow/Stack Exchange sites read-only for 20 minutes on Wed, May 3, 2017 shortly after 8PM US/Eastern (midnight UTC). If you blink, you'll miss it. Short version: There will be a service degradation for up to 20 minutes shortly after 8PM US...

morning
Good to know. I'll schedule my spam bots to do some extra posts at 23:59 UTC. — Suragch Apr 28 at 2:02
 
1 hour later…
09:00
@TomV do you know maillefer.com?
09:11
@McNets No, why?
@TomV They are providers too. And they have FDA certification or are in process.
 
2 hours later…
10:52
Afternoon
what's the best way of telling an external system about changes made to sql table
Sounds not entirely unlike a search engine request
Good afternoon
@AndriyM it's just one table, audit.. so whenever it's changed we need to tell our other users who are working on same item
@swasheck Depends what you define by 'works well.' If you ask the CFO (as I did once) he was happy with it because they'd been able to free up a whole load of money tied up in inventory and implement some process efficiencies. If you ask all the engineers with homebrew access databases they'd say it never works as well as what they'd done themeselves.
@Mathematics Even then you can still try looking for an answer using Internet search :)
If by 'works well' you mean 'easy to integrate with', that really depends on whether you're an end user or a SAP consulting form. It's all a matter of perspective.
11:08
@AndriyM I doubt if internet will give me an easy on this :)
I can create a web service, keep calling sql... but won't it be a sql killer ?
11:28
@Mathematics Perhaps. But searching the Internet is, in a way, like asking a question in an enormous chat room. If you think that the global "chat room" can hardly give you an easy solution, then how do you rate your chances asking around here? :)
Just needs some XML
@TomV Now you have two problems.
I got 99 problems but XML ain't one
@AndriyM I keep making mistake of thinking this room is for SQL Dbas.. , please accept my apologies
@Mathematics that question is just way to broad to be quickly answered in this chat room
11:53
@TomV Pointing me in right direction would be enough, e.g. names of tech I could look at, but no worries... thanks :)
@Mathematics I don't have much knowledge about change tracking but I guess I could give you some pointers by googling. I was just curious why you yourself wouldn't take that course of action before coming here.
@AndriyM Already answered your question, I am not asking anymore or I can leave room if that's not enough ?
@Mathematics I have no issues with your being here, and I can promise you I will have no issues with your asking questions here from now on. Looking back, I guess my reaction may have come across as passive aggressiveness but there was genuine curiosity in my question. Sorry about any trouble caused.
Just answering to help you with curiosity, I did came up with a prototype which works, but I am not happy with architecture, so I thought because this is such a common scenario I might get some insights.

In field of architecture it's difficult to get help from google, there are strategies but they take more time.

Or in other words... google don't help with such queries (I know we can search anything on google but we have to be smart right ? won't going to spend months searching for something...)
12:06
@Mathematics How often is the table changed? Who changes it? Some other application?
@ypercubeᵀᴹ it's random sometime it's only once or twice a day and other days like 100s and it's modified using custom code which is using stored procedures
@Mathematics 100s of times? Are we talking about DDL changes or inserts/updates?
@Mathematics That's all very fair, but when you are asking for help (as opposed to searching the Internet), it really helps those whom you are asking to know what you have already tried. You asked your question broadly without even mentioning the fact that you'd already done some research. It really looked like a lazy question to me.
@ypercubeᵀᴹ insert/updates
12:50
afternoon all
sitting in a Cassandra training the whole week
the presenter is a nice French guy, having some slides in French, too - the 'pardon my French' joke was already made, thanks @MaxVernon and others
2
have fun @dezso
@JackDouglas db<>fiddle still has an issue displaying uniqueidentifier types. Are you already aware of this?
(2017 only)
13:11
@PaulWhite use 2016 dbfiddle.uk/…
13:33
good morning
@JoeObbish Morning Joe
if you want a nice curse (not too violent) , you can say crotte de bique@dezso
hi Joe
13:47
morning Joe
14:23
@AndyK sounds useful
I have a silly rookie problem. I am trying to transpose a table of "settings" which is one row with about 100 columns e.g `Locator, WOMEN_LB, MEN_LB`. The only row would contain those setting values. `UNPIVOT` seems like what I want but I don't want to do any aggregation on the data (like most of the existing questions cover), just transpose. I could easily use Dynamic SQL for this but I figured there was a better way. I can only get it to work for the one column..

SELECT Setting_Name, Setting_value
@PaulWhite yes, I think I need to use a different driver on Linux — I will give that a try
and now I forget the chat markup apparently.
@JackDouglas linux and drivers....sounds about right (I have no idea what I'm talkin about, as always)
linux and php and drivers :S
14:39
@Matt Are all columns of compatible types?
DECLARE @S AS table (v1 integer, v2 integer, v3 integer);
INSERT @S VALUES (1, 2, 3);
SELECT U.[name], U.[value]
FROM @S AS S
UNPIVOT ([value] FOR [name] IN (v1, v2, v3)) AS U;
No. When I combine more columns I get an error
You have to make sure the types match.
After all, you are putting them in one column.
Conversion to strings or sql_variant is a common workaround.
14:40
Because now it will all be in one column so type is important... yes. Ok
Its a mix of int a strings.... its only for my visual display so a simple case should do it.
Thanks for pointing that out.
23
Q: Why does SQL Server require the datatype length to be the same when using UNPIVOT?

bluefeetWhen applying the UNPIVOT function to data that is not normalized, SQL Server requires that the datatype and length be the same. I understand why the datatype must be the same but why does UNPIVOT require the length to be the same? Let's say that I have the following sample data that I need to ...

14:55
i remember that question :)
Thanks @AndriyM and @PaulWhite . A sub query with a casts made it work for me. I should have looked up the error first.
I'm smrter now
@bluefeet You are apparently the pivoting genius since the 7 or so SO questions I have been reading have all be answered by you.
I <3 PIVOTs
you <3 '%PIVOT's
indeed
@Matt That must be some kind of typo, you probably meant "700 or so".
15:03
I have only time to read so many before I got confused.
bluefeet has answered a lot of PIVOT & UNPIVOT questions, here and on SO
@AndriyM yes, I have answered a lot of them
@AndriyM keywords would be :"questions I have been reading"
I didnt want to get to the point where I see the ghost of two blue triangles as I walked around
@Lamak Ah yes, that's a fair point.
15:05
I'm known for my fairness
15:19
@bluefeet I think we already had some inkling of that.
On a completely unrelated note, I had occasion to use UNPIVOT for the first time in a while today.
15:33
with recursive
  a as (select * from t1 union select * from b),
  b as (select * from t2 union select * from a)
select * from a, b ;
Produces this error in Postgres:
> ERROR: mutual recursion between WITH items is not implemented
15:45
Interesting. When you specify RECURSIVE, you can put CTEs in any order regardless of which one references which, and it will work.
WITH RECURSIVE
  a AS (SELECT * FROM b),
  b (x) AS (VALUES(1))
SELECT
  *
FROM
  a, b
;
(Except circular referencing isn't allowed, of course.)
16:21
@AndriyM Not implemented yet ;)
16:36
Oh, I think I sent an infinite recursion query to dbfiddle. Sorry @Jack!
@ypercubeᵀᴹ I don't thin k it has broken anything…
@JackDouglas yes, it was runing for more than a minute and I just clicked on stop loading
User profiles are broken at the moment meta.stackexchange.com/q/295473/194636
 
1 hour later…
17:51
so i'm reading things that note that you can't change a database's default isolation level while it's participating in an availability group but that's not what i'm experiencing right now.
alter database [foo] set read_committed_snapshot on
with rollback immediate
just works. am i missing something?
18:08
@swasheck Where are you reading that? I know little about AGs, but if that's true, I would expect it to relate to SI not RCSI and on the secondary only.
 
2 hours later…
20:01
@JoeObbish thanks @JoeObbish. In the past I've built Agent job streams that run in parallel, and that works well. The use case I'm contemplating here is OLTP related where a single business task consists of several separate non-dependent steps. The response time would be reduced if the steps could run in parallel.
The link gives a clear example of how to use "HierarchyId" data type for a database column. And also the page show cases, how it can be queried. It is self-explanatory. No better example can be given on top of this. — Loganathanpc 30 mins ago
Nice comment for a single link to MS Docs
@TomV Yes, I can see how SSIS would achieve this. I can't figure out how to call out to it from an existing stack of stored procedure calls, however. It could be done in the application layer, too, in a MARS-like way, but then intermediate results have to travel over the network and the app must reimpliment a join algorithm. I was wondering if it could be coordinated through SQL CLR. When I get a moment I'll try it out.
20:27
@MichaelGreen The code ran the jobs immediately. I'm not sure that I understand the problem. Is there too much overhead for your application?
Is Service Broker an option for you @MichaelGreen
Service Borker!!!!!
21:00
all I remember about service broker is getting really angry and declaring that I would never use it again
Bork bork bork
3
@JoeObbish that's a good summary
 
2 hours later…
22:48
@JoeObbish I see what you mean. From within the OLTP task call sp_start_job which will then perform the sub-task asynchronously. Yes, that would do it. Would have to think of a way to wait for a number of async. stream to finish. Polling would do it but risks adding latency, and the idea is to minimise latency. IIRC each job has its own connection so locking would have to be considered carefully, though there are ways around that, too.
This is just a Gedankenexperiment, BTW. No actual application will be hurt during the implementation of this prototype.
23:52
@billinkc When I implemented this in application code I used threads and OS messages to signal completion. So Service Broker is the closest analogy in the DB realm. Is it possible to return control to the SP that started the chain? Hmmm .. I'll have to look into that. Thanks!

« first day (2310 days earlier)      last day (2856 days later) »