Category Archives: SQL Server

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 Airlift and Report Builder 3.0

In SQL Server 2008 Airlift there was small session on Report Builder 3.0 Microsoft Report builder is has below features and it is also integrated with the Share Point

List of features included in Report Builder 3.0

I will walk you through the below features shortly

• Shared Datasets
• SharePoint List Data Extension
• Configuring a Map Layer
• Calculating Aggregates of Aggregates
• Enhanced Support for Expressions
• Overall Page Number and Overall Total Pages
• Page Name
• Render Format
• Rotating Text 270 Degrees (Property)
• Naming Excel Worksheet Tabs while export
• Rendering Reports to Data Feeds
• Writable Variables
• Cached data
• Drill down reports