Advertisement
jlam

CiviCRM MySQL query causing out of memory

Aug 5th, 2011
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 4.14 KB | None | 0 0
  1. SELECT DISTINCT( contact_a.id ) AS id
  2. FROM   civicrm_contact contact_a
  3.        LEFT JOIN civicrm_group_contact `civicrm_group_contact-605`
  4.          ON contact_a.id = `civicrm_group_contact-605`.contact_id
  5.        LEFT JOIN civicrm_group_contact `civicrm_group_contact-608`
  6.          ON contact_a.id = `civicrm_group_contact-608`.contact_id
  7.        LEFT JOIN civicrm_group_contact `civicrm_group_contact-612`
  8.          ON contact_a.id = `civicrm_group_contact-612`.contact_id
  9. WHERE  ( (( ( `civicrm_group_contact-605`.group_id IN ( 605 )
  10.               AND `civicrm_group_contact-605`.status IN ( "Added" ) )
  11.              OR (( contact_a.id IN (SELECT DISTINCT( contact_a.id ) AS id
  12.                                     FROM   civicrm_contact contact_a
  13.                    LEFT JOIN civicrm_value_1_riding__circonscription
  14.                      ON
  15.                 civicrm_value_1_riding__circonscription.entity_id
  16.                 =
  17.                 contact_a.id
  18.                                     WHERE  (
  19.           civicrm_value_1_riding__circonscription.riding
  20.           =
  21.           47001
  22.                                            )
  23.                                            AND ( 1 )
  24.                                            AND 1)
  25.                    AND contact_a.id NOT IN (SELECT contact_id
  26.                                             FROM   civicrm_group_contact
  27.                                             WHERE
  28.                        civicrm_group_contact.group_id = 605
  29.                        AND civicrm_group_contact.status =
  30.                            "Removed")
  31.                      )) ))
  32.           OR (( ( `civicrm_group_contact-608`.group_id IN ( 608 )
  33.                   AND `civicrm_group_contact-608`.status IN ( "Added" ) )
  34.                  OR (( contact_a.id IN (SELECT DISTINCT( contact_a.id ) AS id
  35.                                         FROM   civicrm_contact contact_a
  36.                        LEFT JOIN civicrm_value_1_riding__circonscription
  37.                          ON
  38.                     civicrm_value_1_riding__circonscription.entity_id
  39.                     =
  40.                     contact_a.id
  41.                                         WHERE  (
  42.               civicrm_value_1_riding__circonscription.riding
  43.               =
  44.               47004
  45.                                                )
  46.                                                AND ( 1 )
  47.                                                AND 1)
  48.                        AND contact_a.id NOT IN (SELECT contact_id
  49.                                                 FROM   civicrm_group_contact
  50.                                                 WHERE
  51.                            civicrm_group_contact.group_id =
  52.                            608
  53.                            AND civicrm_group_contact.status
  54.                                =
  55.                                "Removed")
  56.                          )) ))
  57.           OR (( ( `civicrm_group_contact-612`.group_id IN ( 612 )
  58.                   AND `civicrm_group_contact-612`.status IN ( "Added" ) )
  59.                  OR (( contact_a.id IN (SELECT DISTINCT( contact_a.id ) AS id
  60.                                         FROM   civicrm_contact contact_a
  61.                        LEFT JOIN civicrm_value_1_riding__circonscription
  62.                          ON
  63.                     civicrm_value_1_riding__circonscription.entity_id
  64.                     =
  65.                     contact_a.id
  66.                                         WHERE  (
  67.               civicrm_value_1_riding__circonscription.riding
  68.               =
  69.               47008
  70.                                                )
  71.                                                AND ( 1 )
  72.                                                AND 1)
  73.                        AND contact_a.id NOT IN (SELECT contact_id
  74.                                                 FROM   civicrm_group_contact
  75.                                                 WHERE
  76.                            civicrm_group_contact.group_id =
  77.                            612
  78.                            AND civicrm_group_contact.status
  79.                                =
  80.                                "Removed")
  81.                          )) )) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement