Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Intra-query parallelism


Intra-query parallelism

Author
Message
pedro.ribeiro
pedro.ribeiro
SSC-Enthusiastic
SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)

Group: General Forum Members
Points: 123 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
mithun.gite
mithun.gite
Old Hand
Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)

Group: General Forum Members
Points: 331 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
Simon Liddle
Simon Liddle
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1230 Visits: 3178
Just a small (but significant :-P) 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).
Ken McKelvey
Ken McKelvey
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1089 Visits: 7530
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search