Slow Linked Server Query

More
5 years 9 months ago #4501 by dcastro
Hi,

I am trying to find out why a query that is in a view on a MS SQL 2008 server runs forever *I have waited over 10 minutes) while the SQL that makes up the view can be run directly against the Postgres DB in seconds.

View:
SELECT csf.callid, CAST(csf.segmentstarttime AS DATETIME) AS Start_Time, CAST(csf.segmentstoptime AS DATETIME) AS Stop_Time, csf.dialednumber AS First_VDN,
csf.callingparty AS Calling_Party, csf.dispositionkey AS Answering_Disposition, ad.sourcename, ad.acd, ad.agentname, csf.talktime, csf.queuetime, csf.duration,
csf.holdtime, csf.timeheld, ad.agentlogid, sd.skillnumber, sd.skillname
FROM [CS-ACASVR00].ahadatamart.[public].callsegmentfact AS csf INNER JOIN
[CS-ACASVR00].ahadatamart.[public].agentdim AS ad ON csf.answeringagentkey = ad.agentkey AND ad.sourceid > 0 INNER JOIN
[CS-ACASVR00].ahadatamart.[public].skilldim AS sd ON csf.dispositionskillkey = sd.skillkey
WHERE (ad.acd = 2)

Query off of view:
SELECT *
FROM [CallData].[dbo].[vACA_ACD2]
WHERE Start_Time BETWEEN '1/1/2012' AND '2/1/2012'

Query direct on Postgres from pgAdmin III:
SELECT csf.callid, csf.segmentstarttime AS Start_Time, csf.segmentstoptime AS Stop_Time, csf.dialednumber AS First_VDN, csf.callingparty AS Calling_Party,
csf.dispositionkey AS Answering_Disposition, ad.sourcename, ad.acd, ad.agentname, csf.talktime, csf.queuetime, csf.duration, csf.holdtime, csf.timeheld,
ad.agentlogid, sd.skillnumber, sd.skillname
FROM callsegmentfact AS csf INNER JOIN
agentdim AS ad ON csf.answeringagentkey = ad.agentkey AND ad.sourceid > 0 INNER JOIN
skilldim AS sd ON csf.dispositionskillkey = sd.skillkey
WHERE (ad.acd = 2)
AND segmentstarttime BETWEEN '1/1/2012' AND '2/1/2012'

I am thinking it is related to the time stamp field but I cannot be sure. We have other queries that run against this server fine.

Any help would be appreciated.


Thanks,

Dean

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #4503 by Moderator
Hi Dean,
we are working on the issue.

Thank you!

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum