Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

MAXDOP ON INDEXED VIEW Expand / Collapse
Author
Message
Posted Thursday, May 23, 2013 12:59 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, January 21, 2014 8:19 AM
Points: 231, Visits: 736

I have a indexed view and ı m trying to create UNIQUE CLUSTERED index with maxdop=64 setting but sql server engine does not use
this option ? Is it any problem or tip?



CREATE UNIQUE CLUSTERED INDEX XXXX ON [dbo].XXXX_1
(
[Column1] ASC,
[Column2] ASC,
[Column3] ASC,
[Column4] ASC,
[Column5] ASC
)WITH (MAXDOP=64,PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,
SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
Post #1456183
Posted Thursday, May 23, 2013 1:02 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:42 PM
Points: 41,516, Visits: 34,431
What exactly do you mean that it doesn't use that option? What are you seeing?


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1456185
Posted Thursday, May 23, 2013 5:06 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, January 21, 2014 8:19 AM
Points: 231, Visits: 736
I CAN NOT SEE ANY ACTIVITY IN ALL CPU BUT WHEN
I TRY IT TABLE INDEX 64 CPU ARE START TO RUNNING
IS THERE ANY DIFFERENCE
Post #1456246
Posted Thursday, May 23, 2013 5:08 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, January 21, 2014 8:19 AM
Points: 231, Visits: 736
I want to ask is there any difference maxdop setting table index
create and indexed view index create
Post #1456247
Posted Thursday, May 23, 2013 11:48 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:42 PM
Points: 41,516, Visits: 34,431
Shouldn't be a difference

Bear in mind though what MAXDOP is. It's telling SQL the maximum number of processors that it is allowed to use for the operation. So MAXDOP 64 doesn't tell SQL to use 64 processors, it tells SQL to use no more than 64. SQL will choose how many of those 64 that it's allowed to use to run the query over, so it will use anything between 1 and 64.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1456297
Posted Thursday, May 23, 2013 11:56 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, January 21, 2014 8:19 AM
Points: 231, Visits: 736
But when ı create a table index it is use what is changing in the indexed view index create operation
Post #1456298
Posted Friday, May 24, 2013 12:08 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:42 PM
Points: 41,516, Visits: 34,431
Table's bigger?




Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1456300
Posted Friday, May 24, 2013 12:11 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, January 21, 2014 8:19 AM
Points: 231, Visits: 736
Yes ıt table takes 15 minutes to create index

and indexed view takes 2 hour 50 minutes to create
Post #1456302
Posted Friday, May 24, 2013 12:28 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:42 PM
Points: 41,516, Visits: 34,431
Not what I asked.
Is the table bigger than the view?

There's more going on when you index a view than indexing a table, the query that defines the view has to be run to get the data, then the index has to be created, so if the view's inefficient then the creation of the index will take a long time.
Indexing the table however just requires reading the table and then creating the index



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1456305
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse