Category Archives: Notes

All Articles

Max Degree of Parallelism and MAXDOP

Max Degree of Parallelism
If you do not want to use all of the installed processors in your SQL Server operations, you can limit the use of processors by configuring the processor value to a lower number than the actual number of processors installed. For instance, if a server has four processors and you want to use only three for parallelism, then you should set the max degree of parallelism option to 3.

The default option, 0, uses the actual number of processors installed in the system for the parallel execution plans of queries and index operations.

sp_configure ‘max degree of parallelism’, 6;
GO
RECONFIGURE WITH OVERRIDE;
GO

MAXDOP
When you want to use a specific number of processors for an individual query or index operation, you can use the MAXDOP query hint or index option to provide better control. MAXDOP overrides the settings defined in the max degree of parallelism option. The use of MAXDOP is limited to the execution of a query that contains the MAXDOP query hint or index option.

Use below extended procedure to get the number of processors.
EXECUTE xp_msver ‘ProcessorCount’

Example
SELECT
database_id AS databaseID
, QUOTENAME(DB_NAME(database_id)) AS ‘databaseName’
, [OBJECT_ID] AS objectID
, index_id AS indexID
, partition_number AS partitionNumber
, avg_fragmentation_in_percent AS fragmentation
, page_count
, 0 AS ‘defragStatus’ /* 0 = unprocessed, 1 = processed */
FROM sys.dm_db_index_physical_stats (@databaseID, OBJECT_ID(@tableName), Null , Null, @scanMode)
WHERE avg_fragmentation_in_percent >= 30
And index_id > 0
And page_count > 8 — ignore objects with less than 1 extent
And index_level = 0 — leaf-level nodes only, supports @scanMode
OPTION (MaxDop 2);

Join Me on dotnetSpider.com

Dear Readers

Hope you are doing well and enjoying all these database articles. I am also helping the user community on dotnetSpider.com

I am requesting you to join  http://www.dotnetspider.com, which is a very good site for knowledge sharing. The most attractive feature of the site is, it has a revenue sharing program in association with Google. When you post any content or share your knowledge through various sections like Discussion Forums, 90% of the revenue generated from Google Advertisement in those pages are shared with the authors.

Since the revenue sharing program is approved by Google and the revenue is paid to members directly by Google when it reaches certain minimum limit, this is a very reliable program to earn some pocket money during your free time.

If you plan to join this site, please use my user id (tojugalshah123) as the referrer so I will be added in your buddy list

regards,
Jugal Shah

SQL Server 2008 R2 Editions and Key Features

The release of SQL Server is officially called SQL Server 2008 R2, which replaces the code name SQL Server Kilimanjaro. 

SQL Server 2008 R2 edition will come into below different flavors
 

  1. Data Center Edition
  2. Parallel Data Warehouse
  3. Enterprise Edition
  4. Standard Edition

 

List of Key features
 
Data Center Edition

  • Application and Multi-Server Management for enrolling, gaining insights and managing over 25 instances, During the airlift event Microsoft Program Manager mentioned that  they have tested this feature by adding more than 200 servers
  • Highest virtualization support for maximum ROI on consolidation and virtualization
  • High-scale complex event processing with SQL Server StreamInsight
  • Supports more than 8 processors and up to 256 logical processors for highest levels of scale
  • Supports memory limits up to OS maximum

 
Parallel Data Warehouse

  • 10s to 100s TBs enabled by massively parallel processing architecture and compatibility with hardware partners
  • Advanced data warehousing capabilities like Star Join Queries and Change Data Capture
  • Integration with SSIS, SSRS, and SSAS
  • Supports industry standard data warehousing hub and spoke architecture and parallel database copy

 
Enterprise Edition

  • PowerPivot for SharePoint to support the hosting and management of PowerPivot applications in SharePoint
  • Application and Multi-Server Management for enrolling, gaining insights and managing up to 25 instances (CPU and Storage). Microsoft is planning to cover Memory in the next release
  • Master Data Services for data consistency across heterogeneous systems
  • Data Compression now enabled with UCS-2 Unicode support

Standard Edition

  • Backup Compression to reduce data backups by up to 60% and help reduce time spent on backups
  • Managed instance for Application and Multi-Server Management capabilities

Reference: Microsoft Books Online and SQL Server 2008 R2 Airlift Event