SQL Server 2014 introduces a memory database, which is a very good function. Data can be directly stored in the memory, which can be operated directly on the memory, greatly improving the performance.
Today, I think of a problem. What happens if the
Tags: properties LTE record recovery database varchar OBJECT_ID New entityMemory-Optimized tables are a new feature of SQL Server 2014, which can put tables in memory, which significantly improves DML performance.For memory-optimized
\testmemorydbdirectory') toFilegroup Fg_testmemorydb;The CONTAINS memory_optimized_data clause specifies the filegroup used to store memory-optimized table data.Specifies the filegroup stores memory_optimized data in the file system. Only one memory_optimized_data filegroup is allowed per database.Second, create a memory
Label:In-memory database, which refers to the direct manipulation of database data in memory. Compared to the storage on the disk, memory data read and write speed is much higher, so it can improve the performance of the application. Microsoft's SQL Server 2014 was officiall
footprint. You can keep adding tables to the cache, but the operating system can open at the same time a limited number of files, please keep this in mind. If you set the table cache too low, my SQL also strikes, and you should not want to.
Here's what I do with my SQL configuration for the Lightweight cloud server:
\MSSQL12. Mssqlserver\mssql\data\testmemorydbdirectory ')to filegroup fg_testmemorydb;The CONTAINS memory_optimized_data clause specifies the filegroup that is used to store the memory tuning table data.
Specifies that's filegroup stores memory_optimized data in the file system. Only one memory_optimized_data filegroup are allowed per database.
Second, create the memo
In AlwaysOn, SQL Server uses the "step-on" Record of the memory table, and sqlalwayson
Preface
Recently, memory tables were used in a database in the online alwayson environment. After about a week, the monitoring program found a very serious problem. The log files of this d
Added a memory table FileGroup for dbtest, but error occurred while creating memory Optimized tableCannot create memory optimized tables in a database The does not has an online and non-empty Memory_optimized_data Fileg Roup. Use
OR au. type = 3)
UNION ALL
SELECT object_name (object_id) AS name
, Index_id, allocation_unit_id
FROM sys. allocation_units AS au
Inner join sys. partitions AS p
ON au. container_id = p. partition_id
AND au. type = 2
) AS obj
ON bd. allocation_unit_id = obj. allocation_unit_id
WHERE database_id = db_id ()
Group by name, index_id
Order by cached_pages_count DESC
The test results are as follows:
After the table variables are created, the data page is
, object_id, type, create_date from sys. objects Where type = 'U' Order by create_date Desc
-- Query the number of cached pages in the memory
SELECT count (*) AS cached_pages_count
, Name, index_id
FROM sys. dm_ OS _buffer_descriptors AS bd
INNER JOIN
(
SELECT object_name (object_id) AS name
, Index_id, allocation_unit_id
FROM sys. allocation_units AS au
Inner join sys. partitions AS p
ON au. container_id = p. hobt_id
AND (au. type = 1 OR au. type = 3
,type,create_date from sys.objects Where type= ' U ' ORDER by Create_date Desc
--Query in-memory cache pages
SELECT Count (*) as Cached_pages_count
, Name, index_id
From Sys.dm_os_buffer_descriptors as BD
INNER JOIN
(
SELECT object_name (object_id) as name
, index_id, allocation_unit_id
From Sys.allocation_units as Au
INNER JOIN sys.partitions as P
On au.container_id = p.hobt_id
and (Au.type = 1 OR au.type = 3)
UNION All
SELECT object_na
=====================================On the internet for the "second kill" a lot of solutions, data splitting to resolve hot spots, Readpash solve the lock problem, application queuing limit concurrency and many other ways, each has advantages and disadvantages, only to prove a famous saying: All Roads to Rome.=====================================Today take SQL SERVER 2014
Reference: Http://www.infoq.com/cn/news/2013/09/Compiled-QueriesHttp://www.bianceng.cn/database/SQLServer/201502/48247.htmThe SQL Server 2014 Memory database introduces a new structure for traditional tables and stored procedures: memory optimized
SQL Server new Features-- in-memory OLTP (in-memory OLTP )OverviewIn-Memory OLTP (project "Hekaton") is a completely new database engine component that is fully integrated into SQL Server
set is small, then the default as the appearance, a in each record to go to B scan again, actually swept the number of rows equal to a result set row x B result set row number. So if the two result sets are large, the result of the join IS bad.SQL Server 2005 Added merge Join, if the Join field of table A and table B is exactly the field of the clustered index,
possible. 12. Do not write meaningless queries, such as the need to generate an empty table structure:Select Col1,col2 into #t from T where 1=0This type of code does not return any result sets, but consumes system resources and should be changed to this:CREATE TABLE #t (...) 13. It is a good choice to replace in with exists in many cases:Select num from a where num in (select num from B)Replace with the fo
order as much as possible.12. Do not write meaningless queries, such as the need to generate an empty table structure:Select Col1,col2 into #t from T where 1=0This type of code does not return any result sets, but consumes system resources and should be changed to this:CREATE TABLE #t (...)13. It is a good choice to replace in with exists in many cases:Select num from a where num in (select num from B)Repl
Tags: part fun day managing SQL optimization name ALT backup and recovery processA partitioned table is available for the following scenarios1: The table is so big that it can't be put all in memory, or only the last part of the tag has hot data, the others are historical data2: Partitioned
have a large temporary segment to maximize the performance of I/O. The partitions in the temporary section need to be swapped into memory for a hash join. At this time the cost is close to the full table Scan small table + partition number * Full table scan large table cost
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.