SQL query extremely slow

  • 28Views
  • Last Post 01 December 2021
0
votes
Dave Garofalo posted this 29 November 2021

Hello,

When I run the following query against the Zendesk db, it executes almost immediately:

SELECT *

FROM ticket

WHERE Id =382013

 

However the following queries hang for 30+ minutes and I have to close out the browser:

SELECT * 

FROM ticketcomment

WHERE Id = 382013

 

SELECT * 

FROM ticketaudit

WHERE Id = 382013

0
votes
Olena Romanchuk posted this 01 December 2021

Hello Dave,

Skyvia works with Zendesk through their API and is bounded with its limitations.
The TicketComments, TicketAudit and other Ticket* tables are related to the Ticket table as child entities. It means that to retrieve the data from these tables Skyvia reads all existing records from the Ticket table first.
We also see the filtering condition in the query by the ID field, but please note that the ID fields used in the "Where" clause are the TicketComment and TicketAudit Id fields, not the Ticket Id. If you want to filter these records by the Ticket Id value, you should use the TicketId field in the "Where" clause of your query.

 

Best regards,

Olena

Technical Support Engineer 

Close