Quantcast
Channel: SQL Server Database Engine forum
Viewing all 15930 articles
Browse latest View live

Default trace was stopped because of an error. Cause: 0x80070057(The parameter is incorrect.).

$
0
0

Hello, 

We have MS SQL server 2016 Enterprise (SP2-CU5). After starting the server, the default trace file grows to 20 MB, and then stops with this error in ErrorLog:

Trace ID '1' was stopped because of an error. Cause: 0x80070057(The parameter is incorrect.). Restart the trace after correcting the problem.

Error: 19099, Severity: 16, State: 1.

sys.traces is empty and sp_configure "default trace enabled" config_value and run_value is 1.

Any thoughts how to solve this?


Recompile or DISABLE_PARAMETER_SNIFFING

$
0
0

If I would like to make the query to compile the plan for individual parameter, 

should I should recompile or DISABLE_PARAMETER_SNIFFING?

What's the different ?

Multipage allocation vs Large Pageallocation

$
0
0

May I know Multipage allocation vs Large Pageallocation are the same concept ?

Any example of what type of Multipage allocation are?

I check in my sys.dm_os_memory_clerks that column page_sizes_in_bytes are all 8192 .

SQL Server resource pool MAX_MEMORY_PERCENT

$
0
0
  • MIN_MEMORY_PERCENT and MAX_MEMORY_PERCENT

    These settings are the minimum and maximum amount of memory reserved for the resource pool that can not be shared with other resource pools. The memory referenced here is query execution grant memory, not buffer pool memory (for example, data and index pages). Setting a minimum memory value for a pool means that you are ensuring that the percentage of memory specified will be available for any requests that might run in this resource pool. This is an important differentiator compared to MIN_CPU_PERCENT, because in this case memory may remain in the given resource pool even when the pool does not have any requests in the workload groups belonging to this pool. Therefore it is crucial that you be very careful when using this setting, because this memory will be unavailable for use by any other pool, even when there are no active requests. Setting a maximum memory value for a pool means that when requests are running in this pool, they will never get more than this percentage of overall memory.

the above is the definition from the web 

https://docs.microsoft.com/en-us/sql/relational-databases/resource-governor/resource-governor-resource-pool?view=sql-server-ver15

but it didn't tell the MAX_MEMORY_PERCENT control what kind of memory ? buffer pool ? memory grant to query execution ?

dm_os_ring_buffers :RING_BUFFER_OOM'

$
0
0

;WITH rb
AS (
SELECT CAST (record as xml) record_xml FROM sys.dm_os_ring_buffers
WHERE ring_buffer_type = 'RING_BUFFER_OOM'
)
SELECT
rx.value('(@id)[1]', 'bigint') AS RecordID
,DATEADD (ms, -1 * osi.ms_ticks - rx.value('(@time)[1]', 'bigint'), GETDATE()) AS DateOccurred
,rx.value('(OOM/Action)[1]', 'varchar(30)') AS MemoryAction
,rx.value('(OOM/Pool)[1]', 'int') AS MemoryPool
,rx.value('(MemoryRecord/MemoryUtilization)[1]', 'bigint') AS MemoryUtilization
FROM rb
CROSS APPLY rb.record_xml.nodes('Record') record(rx)
CROSS JOIN sys.dm_os_sys_info osi
ORDER BY rx.value('(@id)[1]', 'bigint') 

what's the definition of MemoryPool(Pool) and MemoryUtilization(MemoryUtilization)

sys.dm_os_memory_pools pool_id

$
0
0

https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-memory-pools-transact-sql?view=sql-server-ver15

By default pool_id 0 is internal pool and pool_id 1 is default pool ?

what's actually CMEMTHREAD

$
0
0

https://www.sqlskills.com/help/waits/cmemthread/

what's actually "TREAD-safe-memory-object" ?

DBCC memory status Current commited

$
0
0

May i know if the current committed will also include stack memory allocation ? (which is not control by max server memory ) ?


Filter index question

$
0
0

I am comming to this example

https://www.mssqltips.com/sqlservertip/2353/performance-advantages-of-sql-server-filtered-statistics/

CREATE TABLE MyRegionTable(idINT, Location NVARCHAR(100), USState CHAR(2))
GO
CREATE TABLE MySalesTable(idINT, detail INT, quantity INT)
GO
CREATE CLUSTERED INDEX IDX_d1 ON MyRegionTable(id)
GO
CREATE INDEX IDX_MyRegionTable_name ON MyRegionTable(Location)
GO
CREATE STATISTICS IDX_MyRegionTable_id_name ON MyRegionTable(id,Location)
GO
CREATE CLUSTERED INDEX IDX_MySalesTable_id_detailON MySalesTable(id,detail)
GO
INSERT MyRegionTable VALUES(0,'Atlanta', 'GA')
INSERT MyRegionTable VALUES(1, 'San Francisco', 'CA')
GO
SET NOCOUNT ON
-- MySalesTable will contain 1 row for Atlanta and 1000 rows for San Francisco
INSERT MySalesTable VALUES(0, 0, 50)
DECLARE @i INT
SET
@i = 1
WHILE @i <=1000 BEGIN
INSERT
MySalesTable VALUES (1,@i, @i*3)
SET @i = @i +1
END
GO
UPDATE STATISTICS MyRegionTable WITH fullscan
UPDATE STATISTICS MySalesTable WITH fullscan
GO

--- So when come into the following statement 

SELECT detail FROM MyRegionTable JOIN MySalesTable ON MyRegionTable.id = MySalesTable.id
WHERE
Location='Atlanta'OPTION (recompile)

so we know the estimation is wrong. But I am question why the join query doesn't consider the stats of 

IDX_MySalesTable_id_detail?????? 

SQL Server 2016 slower than SQL Server 2008

$
0
0

I have two databases with the same data, one on an SQL Server 2008 R2 instance, and one on an SQL Server 2016 instance. Both SQL Server instances are on the same machine, and the database files are on the same disk. The SQL Server 2016 has Legacy Cardinality Estimation = ON. Both instances and databases have Max DOP=1. With the SQLQueryStress tool, I run a stored procedure 100 times on the SQL Server 2008 R2 instance and then on the SQL Server 2016 instance. The total time on the SQL Server 2008 R2 is 1,83 sec whereas the total time on the SQL Server 2016 is 2,16 sec. The execution plans are exactly the same, why is SQL Server 2016 slower?

The Results in the SQLQueryStress:

The execution plan of the stored procedure on the SQL Server 2008 R2 database:


The execution plan of the stored procedure on the SQL Server 2016 database:




Viewing all 15930 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>