> Warning: Range value list for partition function 'YourMom' is not sorted by value. Mapping of partitions to filegroups during CREATE PARTITION SCHEME will use the sorted boundary values if the function 'YourMom' is referenced in CREATE PARTITION SCHEME.
CREATE PARTITION FUNCTION YourMom ( INT )
AS RANGE LEFT FOR VALUES ( 5, 3, 1, 4, 2 );
4 schedulers, round robin partition forces equal work to all involved schedulers, MAXDOP 3 means I can get the three free schedulers, MAXDOP 4 means a thread must be assigned to the overloaded one
wait time for SOS_SCHEDULER_YIELD = 2456 ms total elapsed time for query = 3674 ms (3674 - 2456) / 4 = 304 ms of work to do per thread I roughly got 304 / 2456 = 12.3% of the quantums from scheduler 3
@sp_BlitzErik right, but I'm using that CPU burning query
Are there some cases where writes from system threads (e.g. ghost cleanup, page split) are attributed to a user SPID? I'm looking at a case where (@P0 nvarchar(4000))select val from myHeapTable where setting= @P0 run through sp_execute inside an implicit transaction is causing an LOP_BEGIN_XACT record to be written out, but only rarely when the query is run.
Extended events shows the command caused two writes.
I'm trying to load a series of CSVs on S3 into a Redshift cluster using the copy command and I'm getting the error "[Amazon](500310) Invalid operation: LOAD source is not supported. (Hint: only S3 or DynamoDB or EMR based load is allowed);". The source is definitely S3. Any ideas?
Specific command that I'm running looks like:
create table #Foo (
--bunch of fields
primary key (FooID)
);
copy #Foo
from 'arn:aws:s3:::mybucket/random_id/s3test.manifest'
manifest;
CREATE OR ALTER FUNCTION dbo.OneRow()
RETURNS TABLE
WITH SCHEMABINDING
AS RETURN
SELECT MIN(h.c) AS dead_col
FROM ( SELECT CONVERT(INT, NULL) GROUP BY() ) AS h(c);
GO
SELECT *
FROM dbo.OneRow() AS o
JOIN dbo.Dummy AS d
ON ISNULL(o.dead_col, d.Id) = d.Id
@JoeObbish same as pass, don't have enough time to write all new material. If you have any feedback about that I'd love to hear it. For the one row thing, only if you're very bored. Mostly just curiosity.
so if you have a mstvf that returns one null value, you can join to it on like t.id = isnull(mstvf.id, t.id) and the whole subtree would get a 1 row estimate
And even if it always returns the last row from the list that was inserted, who cares? Why would we want to use select @v = value from t; ? How "fast" would that be in a big table?
@Sami Well, your wording was, "the last row in the table", which is not the same thing as "the last value that is returned". By definition, rows in a table don't have an inherent order.
Just because you observed a certain behaviour, it doesn't mean that it'll behave always the same. The row returned may be any of the rows of the table, in other occasions.
When we use HASHBYTES is there any way to return the string from the hashed one?
for example:
CREATE TABLE HashedStrings (
ID INT IDENTITY (1,1) NOT NULL,
HashedStr NVARCHAR(MAX)
);
INSERT INTO HashedStrings VALUES
(HASHBYTES ('SHA2_512', N'String1'));
SELECT HashedStr
FROM HashedStrings;