Page MenuHomePhabricator

Slow CiviCRM query
Open, Needs TriagePublic

Description

A recent query hurt our server

It was killed after 5724 seconds:

REPLACE INTO civicrm_temp_custom_entityID_6847c4a629fb239109e383f788534d9c ( entity_id )

SELECT     distinct ca.id
FROM       civicrm_activity ca
INNER JOIN civicrm_activity_contact cat ON cat.activity_id = ca.id
INNER JOIN civicrm_contact c ON cat.contact_id = c.id
LEFT  JOIN civicrm_email e ON cat.contact_id = e.contact_id
LEFT  JOIN civicrm_option_group og ON og.name = 'activity_type'
LEFT  JOIN civicrm_option_value ov ON ( ov.option_group_id = og.id )
WHERE      (
             (c.sort_name LIKE '%ay%' OR c.display_name LIKE '%ay%' OR c.nick_name LIKE '%ay%')
             OR
             (e.email LIKE '%ay%' AND ca.activity_type_id = ov.value AND ov.name IN ('Inbound Email', 'Email') )
           )
AND        (ca.is_deleted = 0 OR ca.is_deleted IS NULL)
AND        (c.is_deleted = 0 OR c.is_deleted IS NULL)

LIMIT 11

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 9 2017, 9:32 PM
Peachey88 updated the task description. (Show Details)Jan 10 2017, 9:59 AM

This is old & may not exist any more but I can at least search the codebase for it to see if it's still a landmine in the code

Aklapper removed Eileenmcnaughton as the assignee of this task.Jun 19 2020, 4:14 PM

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)