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

Intra-query parallelism Expand / Collapse
Author
Message
Posted Monday, March 30, 2009 10:49 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Sunday, May 31, 2009 10:19 AM
Points: 103, Visits: 982
Hi masters,

I have a query, when i execute it, it gives me the folowing message:

"Intra-query parallelism caused your server command (process ID #58) to deadlock. Rerun the query without intra-query parallelism by using the query hint option (maxdop 1)."


the query is this one:


select a.rgt from bulk_1 as a, todos2 as b
where a.rgt <> b.rgt and a.bictb=b.bictb


Note:
Bulk_1 is a table and todos 2 is the folowing view:


create view TODOS2
as
select
a.rgt,a.codctt,b.Cif,b.morada,b.dta_alteracao,b.bictb as bictb from allt as a ,contribuintesest as b
where a.codctb=b.codctb
union all
select
a.rgt,a.codctt,b.CIF,b.morada,b.dta_alteracao,null as bictb from allt as a ,contribuintee as b
where a.codctb=b.codctb
union all
select
a.rgt,a.codctt,b.CIF,b.morada,b.dta_alteracao,null as bictb from allt as a ,contribuinteinst as b
where a.codctb=b.codctb



Can someone help me understanding what is the problem?

tks,

Pedro
Post #686309
Posted Tuesday, March 31, 2009 12:32 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, May 11, 2010 2:15 AM
Points: 327, Visits: 364
hi,'

try this one

select a.rgt from bulk_1 as a, todos2 as b
where a.rgt <> b.rgt and a.bictb=b.bictb
OPTION (MAXDOP 1)


or


EXEC sp_configure 'show advanced option', '1'
RECONFIGURE
GO
sp_configure 'max degree of parallelism', 0
RECONFIGURE
GO

thanks
Mithun
Post #686749
Posted Tuesday, March 31, 2009 3:11 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, November 20, 2014 4:03 AM
Points: 1,135, Visits: 3,146
Just a small (but significant ) correction to the above post:

sp_configure 'max degree of parallelism', 1

This issue appears in certain conditions (I've only seen it happening with certain statements using UNION ALLs) in which more than one processor (or processor core) is utilised for a query ("intra-query parallelism"). I understand it to be caused by the processes running over both processors deadlocking each other.

If you know the statements that are causing it, add the MaxDOP hint. That query will then be forced to operate on only one processor.

If you cannot locate it, then you can use the sp_configure 'max degree of parallelism' option but be warned that it means your whole SQL Server instance will be confined to only 1 processor (I think that is the scope of it - check BOL to be sure).
Post #686805
Posted Tuesday, March 31, 2009 3:43 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 4:59 AM
Points: 850, Visits: 5,581
Or you could re-write the view to avoid the problem:

CREATE VIEW TODOS2
AS

SELECT A.rgt, A.codctt, D.CIF, D.morada, D.dta_alteracao, D.bictb
FROM allt AS A
JOIN
(
SELECT B1.codctb, B1.CIF, B1.morada, B1.dta_alteracao, B1.bictb
FROM contribuintesest AS B1
UNION ALL
SELECT B2.codctb, B2.CIF, B2.morada, B2.dta_alteracao, NULL
FROM contribuintee AS B2
UNION ALL
SELECT B3.codctb, B3.CIF, B3.morada, B3.dta_alteracao, NULL
FROM contribuinteinst B3
) D
ON A.codctb = D.codctb

Post #686813
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse