0

I have this query inside an automation where it is executed with many other queries that are working fine, but when I run this one, the following error appears: query failed: timeout. How could I improve it so that it takes less time to run? I must say that testing it in isolation in Query studio works fine. Thanks in advance!

SELECT x.[AccountID],
                x.[OYBAccountID],
                x.[JobID],
                x.[ListID],
                x.[BatchID],
                x.[SubscriberID],
                x.[SubscriberKey],
                x.[EventDate],
                x.[Domain],
                x.[TriggererSendDefinitionObjectID],
                x.[TriggeredSendCustomerKey]
FROM (
     SELECT [AccountID],
                     [OYBAccountID],
                     [JobID],
                     [ListID],
                     [BatchID],
                     [SubscriberID],
                     [SubscriberKey],
                     [EventDate],
                     [Domain],
                     [TriggererSendDefinitionObjectID],
                     [TriggeredSendCustomerKey],
                     ROW_NUMBER() 
                     
    OVER (
          PARTITION BY AccountID,
                                     JobID,
                                     ListID,
                                     BatchID,
                                     SubscriberID,
                                     SubscriberKey, 
                                     EventDate,
                                     Domain
                     ORDER BY EventDate ASC
               ) as ranking
    FROM _Sent 
    
) x
WHERE ranking = 1
1
  • What's the rationale for doing a partition on _Sent? Commented Jun 24, 2022 at 11:59

1 Answer 1

0

Usually writing queries on dataview will take much time to give results, try limiting the result by adding Date Filter if any, else create DE and run the same query by using Automation studio.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .