Dashboard > CRM > Requirements - ACTIVE Discussion and Revision > Optimization Analysis
Optimization Analysis Log In | Sign Up   View a printable version of the current page.

Added by David Greenberg , last edited by Manish Zope on Sep 15, 2005  (view change)
Labels: 
(None)

Use this section to report results from optimization analysis efforts.

Queries per Page

CiviCRM Page/URL Num Queries
contact/search/basic 2
contact/search/contact/search/basic 7
contact/search/advanced 9
contact/view 31
contact/view/activity 15
contact/view/rel 10
contact/view/group 12
contact/view/note 8
contact/view/tag 8
contact/view/cd 13
contact/addI 5
contact/addH 5
contact/addO 5
group/search 8
admin/tag 1
admin/reltype 1
admin/locationType 2
admin/activityType 2
admin/custom/group 1
admin/uf/group 1
admin/IMProvider 1
admin/mobileProvider 1

Breakdown of some of the Above URLs having more no of queries

contact/view

1) 3 Query       SELECT  id, title  FROM civicrm_group  WHERE  civicrm_group.domain_id = 1 AND  civicrm_group.is_active = 1    ORDER BY title

2) 3 Query       SELECT count(DISTINCT civicrm_contact.id) 
        FROM civicrm_contact 
WHERE civicrm_contact.id = 42 AND  ( 1 )

3) 3 Query       SELECT    civicrm_contact.display_name as display_name,
          civicrm_contact.contact_type as contact_type,
          civicrm_email.email          as email       
FROM      civicrm_contact
LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
                               civicrm_contact.id = civicrm_location.entity_id AND
                               civicrm_location.is_primary = 1)
LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
WHERE     civicrm_contact.id = 42
		      
4) 3 Query       SELECT  id, contact_type  FROM civicrm_contact  WHERE  civicrm_contact.id = 42
		      
5) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Inline' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight, title
		      
6) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Tab' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight
		      
7) 3 Query       SELECT  id, name  FROM civicrm_activity_type  WHERE id > 3 AND  civicrm_activity_type.domain_id = 1 AND  civicrm_activity_type.is_active = 1    ORDER BY name
		      
8) 3 Query       SELECT * FROM civicrm_contact  WHERE  civicrm_contact.id = 42
		      
9) 3 Query       SELECT * FROM civicrm_individual  WHERE  civicrm_individual.contact_id = 42
		      
10) 3 Query       SELECT * FROM civicrm_location  WHERE  civicrm_location.entity_table  = 'civicrm_contact' AND  civicrm_location.entity_id = 42    ORDER BY is_primary desc
		      
11) 3 Query       SELECT * FROM civicrm_address  WHERE  civicrm_address.location_id = 72
		      
12) 3 Query       SELECT * FROM civicrm_phone  WHERE  civicrm_phone.location_id = 72    ORDER BY is_primary desc
		      
13) 3 Query       SELECT * FROM civicrm_email  WHERE  civicrm_email.location_id = 72    ORDER BY is_primary desc
		      
14) 3 Query       SELECT * FROM civicrm_im  WHERE  civicrm_im.location_id = 72    ORDER BY is_primary desc
		      
15) 3 Query       SELECT count(civicrm_note.id) as DATAOBJECT_NUM
                FROM civicrm_note   WHERE  civicrm_note.entity_table  = 'civicrm_contact' AND  civicrm_note.entity_id = 42
		      
16) 3 Query       SELECT * FROM civicrm_note  WHERE  civicrm_note.entity_table  = 'civicrm_contact' AND  civicrm_note.entity_id = 42    ORDER BY modified_date desc   LIMIT 0, 3
		      
17) 3 Query       (  SELECT civicrm_relationship.id as civicrm_relationship_id,
                              civicrm_contact.sort_name as sort_name,
                              civicrm_address.street_address as street_address,
                              civicrm_address.city as city,
                              civicrm_address.postal_code as postal_code,
                              civicrm_state_province.abbreviation as state,
                              civicrm_country.name as country,
                              civicrm_email.email as email,
                              civicrm_phone.phone as phone,
                              civicrm_contact.id as civicrm_contact_id,
                              civicrm_contact.contact_type as contact_type,
                              civicrm_relationship.contact_id_b as contact_id_b,
                              civicrm_relationship.contact_id_a as contact_id_a,
                              civicrm_relationship_type.id as civicrm_relationship_type_id,
                              civicrm_relationship.start_date as start_date,
                              civicrm_relationship.end_date as end_date,
                              civicrm_relationship.is_active as is_active , civicrm_relationship_type.name_a_b as name_a_b,
                              civicrm_relationship_type.name_b_a as relation  FROM civicrm_contact, civicrm_relationship, civicrm_relationship_type
                        LEFT OUTER JOIN civicrm_location ON ( civicrm_location.entity_table = 'civicrm_contact' AND
                                                              civicrm_contact.id = civicrm_location.entity_id AND
                                                              civicrm_location.is_primary = 1 )
                        LEFT OUTER JOIN civicrm_address ON (civicrm_location.id = civicrm_address.location_id )
                        LEFT OUTER JOIN civicrm_phone ON (civicrm_location.id = civicrm_phone.location_id AND civicrm_phone.is_primary = 1)
                        LEFT OUTER JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
                        LEFT OUTER JOIN civicrm_state_province ON (civicrm_address.state_province_id = civicrm_state_province.id)
                        LEFT OUTER JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id)  WHERE civicrm_relationship.relationship_type_id = civicrm_relationship_type.id  AND civicrm_relationship.contact_id_b = 42 AND civicrm_relationship.contact_id_a = civicrm_contact.id  ) UNION (  SELECT civicrm_relationship.id as civicrm_relationship_id,
                              civicrm_contact.sort_name as sort_name,
                              civicrm_address.street_address as street_address,
                              civicrm_address.city as city,
                              civicrm_address.postal_code as postal_code,
                              civicrm_state_province.abbreviation as state,
                              civicrm_country.name as country,
                              civicrm_email.email as email,
                              civicrm_phone.phone as phone,
                              civicrm_contact.id as civicrm_contact_id,
                              civicrm_contact.contact_type as contact_type,
                              civicrm_relationship.contact_id_b as contact_id_b,
                              civicrm_relationship.contact_id_a as contact_id_a,
                              civicrm_relationship_type.id as civicrm_relationship_type_id,
                              civicrm_relationship.start_date as start_date,
                              civicrm_relationship.end_date as end_date,
                              civicrm_relationship.is_active as is_active , civicrm_relationship_type.name_a_b as name_a_b,
                              civicrm_relationship_type.name_a_b as relation  FROM civicrm_contact, civicrm_relationship, civicrm_relationship_type
                        LEFT OUTER JOIN civicrm_location ON ( civicrm_location.entity_table = 'civicrm_contact' AND
                                                              civicrm_contact.id = civicrm_location.entity_id AND
                                                              civicrm_location.is_primary = 1 )
                        LEFT OUTER JOIN civicrm_address ON (civicrm_location.id = civicrm_address.location_id )
                        LEFT OUTER JOIN civicrm_phone ON (civicrm_location.id = civicrm_phone.location_id AND civicrm_phone.is_primary = 1)
                        LEFT OUTER JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
                        LEFT OUTER JOIN civicrm_state_province ON (civicrm_address.state_province_id = civicrm_state_province.id)
                        LEFT OUTER JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id)  WHERE civicrm_relationship.relationship_type_id = civicrm_relationship_type.id  AND civicrm_relationship.contact_id_a = 42 AND civicrm_relationship.contact_id_b = civicrm_contact.id  )  ORDER BY civicrm_relationship_type_id, sort_name  LIMIT 0, 3
		      
18) 3 Query       (  SELECT count(DISTINCT civicrm_relationship.id) as cnt1, 0 as cnt2  FROM civicrm_contact, civicrm_relationship, civicrm_relationship_type
                        LEFT OUTER JOIN civicrm_location ON ( civicrm_location.entity_table = 'civicrm_contact' AND
                                                              civicrm_contact.id = civicrm_location.entity_id AND
                                                              civicrm_location.is_primary = 1 )
                        LEFT OUTER JOIN civicrm_address ON (civicrm_location.id = civicrm_address.location_id )
                        LEFT OUTER JOIN civicrm_phone ON (civicrm_location.id = civicrm_phone.location_id AND civicrm_phone.is_primary = 1)
                        LEFT OUTER JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
                        LEFT OUTER JOIN civicrm_state_province ON (civicrm_address.state_province_id = civicrm_state_province.id)
                        LEFT OUTER JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id)  WHERE civicrm_relationship.relationship_type_id = civicrm_relationship_type.id  AND civicrm_relationship.contact_id_b = 42 AND civicrm_relationship.contact_id_a = civicrm_contact.id  ) UNION (  SELECT 0 as cnt1, count(DISTINCT civicrm_relationship.id) as cnt2  FROM civicrm_contact, civicrm_relationship, civicrm_relationship_type
                        LEFT OUTER JOIN civicrm_location ON ( civicrm_location.entity_table = 'civicrm_contact' AND
                                                              civicrm_contact.id = civicrm_location.entity_id AND
                                                              civicrm_location.is_primary = 1 )
                        LEFT OUTER JOIN civicrm_address ON (civicrm_location.id = civicrm_address.location_id )
                        LEFT OUTER JOIN civicrm_phone ON (civicrm_location.id = civicrm_phone.location_id AND civicrm_phone.is_primary = 1)
                        LEFT OUTER JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
                        LEFT OUTER JOIN civicrm_state_province ON (civicrm_address.state_province_id = civicrm_state_province.id)
                        LEFT OUTER JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id)  WHERE civicrm_relationship.relationship_type_id = civicrm_relationship_type.id  AND civicrm_relationship.contact_id_a = 42 AND civicrm_relationship.contact_id_b = civicrm_contact.id  )
050909 16:26:35	      

19) 3 Query       SELECT 
                    civicrm_group_contact.id as civicrm_group_contact_id, 
                    civicrm_group.title as group_title,
                    civicrm_group_contact.status as status, 
                    civicrm_group.id as group_id,
                    civicrm_subscription_history.date as date,
                    civicrm_subscription_history.method as method FROM civicrm_contact  LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id  LEFT JOIN civicrm_group ON civicrm_group.id =  civicrm_group_contact.group_id  LEFT JOIN civicrm_subscription_history
                                   ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
                                  AND civicrm_group_contact.group_id   =  civicrm_subscription_history.group_id WHERE civicrm_contact.id = 42 AND civicrm_group.is_active = '1'  AND civicrm_group_contact.status = "Added" AND  ( 1 )   ORDER BY civicrm_group.title  LIMIT 0, 3
		      
20) 3 Query       SELECT count(DISTINCT civicrm_group_contact.id) FROM civicrm_contact  LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id  LEFT JOIN civicrm_group ON civicrm_group.id =  civicrm_group_contact.group_id  LEFT JOIN civicrm_subscription_history
                                   ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
                                  AND civicrm_group_contact.group_id   =  civicrm_subscription_history.group_id WHERE civicrm_contact.id = 42 AND civicrm_group.is_active = '1'  AND civicrm_group_contact.status = "Added" AND  ( 1 )
		      
21) 3 Query       SELECT * FROM civicrm_activity_history  WHERE  civicrm_activity_history.entity_id = 42    ORDER BY activity_date desc, activity_type asc   LIMIT 0, 3
		      
22) 3 Query       SELECT count(civicrm_activity_history.id) as DATAOBJECT_NUM
                FROM civicrm_activity_history   WHERE  civicrm_activity_history.entity_table  = 'civicrm_contact' AND  civicrm_activity_history.entity_id = 42
		      
23) 3 Query       ( SELECT
    civicrm_phonecall.id as id,
    civicrm_phonecall.source_contact_id as source_contact_id, 
    civicrm_phonecall.target_entity_id as  target_contact_id,
    civicrm_phonecall.subject as subject,
    civicrm_phonecall.scheduled_date_time as date,
    civicrm_phonecall.status as status,
    source.display_name as sourceName,
    target.display_name as targetName,
    civicrm_activity_type.id  as activity_type_id,
    civicrm_activity_type.name  as activity_type
  FROM civicrm_activity_type, civicrm_phonecall, civicrm_contact source, civicrm_contact target
  WHERE
    civicrm_activity_type.id = 2 AND
    civicrm_phonecall.source_contact_id = source.id AND
    civicrm_phonecall.target_entity_table = 'civicrm_contact' AND
    civicrm_phonecall.target_entity_id = target.id AND
    ( civicrm_phonecall.source_contact_id = 42 
    OR civicrm_phonecall.target_entity_id = 42 ) 
    AND civicrm_phonecall.status != 'Completed'
 ) UNION
( SELECT   
    civicrm_meeting.id as id,
    civicrm_meeting.source_contact_id as source_contact_id,
    civicrm_meeting.target_entity_id as  target_contact_id,
    civicrm_meeting.subject as subject,
    civicrm_meeting.scheduled_date_time as date,
    civicrm_meeting.status as status,
    source.display_name as sourceName,
    target.display_name as targetName,
    civicrm_activity_type.id  as activity_type_id,
    civicrm_activity_type.name  as activity_type
  FROM civicrm_activity_type, civicrm_meeting, civicrm_contact source, civicrm_contact target
  WHERE
    civicrm_activity_type.id = 1 AND
    civicrm_meeting.source_contact_id = source.id AND
    civicrm_meeting.target_entity_table = 'civicrm_contact' AND
    civicrm_meeting.target_entity_id = target.id AND
    ( civicrm_meeting.source_contact_id = 42
    OR civicrm_meeting.target_entity_id = 42 ) 
    AND civicrm_meeting.status != 'Completed'
) UNION
( SELECT   
    civicrm_activity.id as id,
    civicrm_activity.source_contact_id as source_contact_id,
    civicrm_activity.target_entity_id as  target_contact_id,
    civicrm_activity.subject as subject,
    civicrm_activity.scheduled_date_time as date,
    civicrm_activity.status as status,
    source.display_name as sourceName,
    target.display_name as targetName,
    civicrm_activity_type.id  as activity_type_id,
    civicrm_activity_type.name  as activity_type
  FROM civicrm_activity, civicrm_contact source, civicrm_contact target ,civicrm_activity_type
  WHERE
    civicrm_activity.source_contact_id = source.id AND
    civicrm_activity.target_entity_table = 'civicrm_contact' AND
    civicrm_activity.target_entity_id = target.id AND
    ( civicrm_activity.source_contact_id = 42 
    OR civicrm_activity.target_entity_id = 42 ) AND
    civicrm_activity_type.id = civicrm_activity.activity_type_id AND civicrm_activity_type.is_active = 1 AND 
    civicrm_activity.status != 'Completed'
)
 ORDER BY date desc  LIMIT 0, 3
		      
24) 3 Query       SELECT count(*) FROM civicrm_meeting 
                    WHERE (civicrm_meeting.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42
                    OR source_contact_id = 42) 
                    AND status != 'Completed'
		      
25) 3 Query       SELECT count(*) FROM civicrm_phonecall 
                    WHERE (civicrm_phonecall.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42 
                    OR source_contact_id = 42) 
                    AND status != 'Completed'
		      
26) 3 Query       SELECT count(*) FROM civicrm_activity,civicrm_activity_type 
                    WHERE (civicrm_activity.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42 
                    OR source_contact_id = 42) 
                    AND civicrm_activity_type.id = civicrm_activity.activity_type_id 
                    AND civicrm_activity_type.is_active = 1  AND status != 'Completed'
		      
27) 3 Query       SELECT  id, name  FROM civicrm_location_type  WHERE  civicrm_location_type.domain_id = 1 AND  civicrm_location_type.is_active = 1    ORDER BY name
		      
28) 3 Query       SELECT  id, name  FROM civicrm_state_province     ORDER BY name
		      
29) 3 Query       SELECT  id, name  FROM civicrm_country     ORDER BY name
		      
30) 3 Query       SELECT  id, name  FROM civicrm_tag  WHERE  civicrm_tag.domain_id = 1    ORDER BY name
		      
31) 3 Query       SELECT * FROM civicrm_entity_tag  WHERE  civicrm_entity_tag.entity_table  = 'civicrm_contact' AND  civicrm_entity_tag.entity_id = 42

contact/view/acitvity

1) 3 Query       SELECT  id, title  FROM civicrm_group  WHERE  civicrm_group.domain_id = 1 AND  civicrm_group.is_active = 1    ORDER BY title

2) 3 Query       SELECT count(DISTINCT civicrm_contact.id) 
        FROM civicrm_contact 
WHERE civicrm_contact.id = 42 AND  ( 1 )
		      
3) 3 Query       SELECT    civicrm_contact.display_name as display_name,
          civicrm_contact.contact_type as contact_type,
          civicrm_email.email          as email       
FROM      civicrm_contact
LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
                               civicrm_contact.id = civicrm_location.entity_id AND
                               civicrm_location.is_primary = 1)
LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
WHERE     civicrm_contact.id = 42
050909 17:38:43	      
		      
4) 3 Query       SELECT  id, contact_type  FROM civicrm_contact  WHERE  civicrm_contact.id = 42
		      		      
5) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Inline' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight, title
		      		      
6) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Tab' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight
		      		      
7) 3 Query       SELECT  id, name  FROM civicrm_activity_type  WHERE id > 3 AND  civicrm_activity_type.domain_id = 1 AND  civicrm_activity_type.is_active = 1    ORDER BY name
		      		      
8) 3 Query       SELECT count(*) FROM civicrm_meeting 
                    WHERE (civicrm_meeting.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42
                    OR source_contact_id = 42) 
                    AND status != 'Completed'
		      		      
9) 3 Query       SELECT count(*) FROM civicrm_phonecall 
                    WHERE (civicrm_phonecall.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42 
                    OR source_contact_id = 42) 
                    AND status != 'Completed'
		      		      
10) 3 Query       SELECT count(*) FROM civicrm_activity,civicrm_activity_type 
                    WHERE (civicrm_activity.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42 
                    OR source_contact_id = 42) 
                    AND civicrm_activity_type.id = civicrm_activity.activity_type_id 
                    AND civicrm_activity_type.is_active = 1  AND status != 'Completed'
		      		      
11) 3 Query       SELECT count(civicrm_activity_history.id) as DATAOBJECT_NUM
                FROM civicrm_activity_history   WHERE  civicrm_activity_history.entity_table  = 'civicrm_contact' AND  civicrm_activity_history.entity_id = 42
		      		      
12) 3 Query       SELECT count(*) FROM civicrm_meeting 
                    WHERE (civicrm_meeting.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42
                    OR source_contact_id = 42) 
                    AND status != 'Completed'
		      		      
13) 3 Query       SELECT count(*) FROM civicrm_phonecall 
                    WHERE (civicrm_phonecall.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42 
                    OR source_contact_id = 42) 
                    AND status != 'Completed'
		      		      
14) 3 Query       SELECT count(*) FROM civicrm_activity,civicrm_activity_type 
                    WHERE (civicrm_activity.target_entity_table = 'civicrm_contact' 
                    AND target_entity_id = 42 
                    OR source_contact_id = 42) 
                    AND civicrm_activity_type.id = civicrm_activity.activity_type_id 
                    AND civicrm_activity_type.is_active = 1  AND status != 'Completed'
		      		      
15) 3 Query       ( SELECT
    civicrm_phonecall.id as id,
    civicrm_phonecall.source_contact_id as source_contact_id, 
    civicrm_phonecall.target_entity_id as  target_contact_id,
    civicrm_phonecall.subject as subject,
    civicrm_phonecall.scheduled_date_time as date,
    civicrm_phonecall.status as status,
    source.display_name as sourceName,
    target.display_name as targetName,
    civicrm_activity_type.id  as activity_type_id,
    civicrm_activity_type.name  as activity_type
  FROM civicrm_activity_type, civicrm_phonecall, civicrm_contact source, civicrm_contact target
  WHERE
    civicrm_activity_type.id = 2 AND
    civicrm_phonecall.source_contact_id = source.id AND
    civicrm_phonecall.target_entity_table = 'civicrm_contact' AND
    civicrm_phonecall.target_entity_id = target.id AND
    ( civicrm_phonecall.source_contact_id = 42 
    OR civicrm_phonecall.target_entity_id = 42 ) 
    AND civicrm_phonecall.status != 'Completed'
 ) UNION
( SELECT   
    civicrm_meeting.id as id,
    civicrm_meeting.source_contact_id as source_contact_id,
    civicrm_meeting.target_entity_id as  target_contact_id,
    civicrm_meeting.subject as subject,
    civicrm_meeting.scheduled_date_time as date,
    civicrm_meeting.status as status,
    source.display_name as sourceName,
    target.display_name as targetName,

    civicrm_activity_type.id  as activity_type_id,
    civicrm_activity_type.name  as activity_type
  FROM civicrm_activity_type, civicrm_meeting, civicrm_contact source, civicrm_contact target
  WHERE
    civicrm_activity_type.id = 1 AND
    civicrm_meeting.source_contact_id = source.id AND
    civicrm_meeting.target_entity_table = 'civicrm_contact' AND
    civicrm_meeting.target_entity_id = target.id AND
    ( civicrm_meeting.source_contact_id = 42
    OR civicrm_meeting.target_entity_id = 42 ) 
    AND civicrm_meeting.status != 'Completed'
) UNION
( SELECT   
    civicrm_activity.id as id,
    civicrm_activity.source_contact_id as source_contact_id,
    civicrm_activity.target_entity_id as  target_contact_id,
    civicrm_activity.subject as subject,
    civicrm_activity.scheduled_date_time as date,
    civicrm_activity.status as status,
    source.display_name as sourceName,
    target.display_name as targetName,
    civicrm_activity_type.id  as activity_type_id,
    civicrm_activity_type.name  as activity_type
  FROM civicrm_activity, civicrm_contact source, civicrm_contact target ,civicrm_activity_type
  WHERE
    civicrm_activity.source_contact_id = source.id AND
    civicrm_activity.target_entity_table = 'civicrm_contact' AND
    civicrm_activity.target_entity_id = target.id AND
    ( civicrm_activity.source_contact_id = 42 
    OR civicrm_activity.target_entity_id = 42 ) AND
    civicrm_activity_type.id = civicrm_activity.activity_type_id AND civicrm_activity_type.is_active = 1 AND 
    civicrm_activity.status != 'Completed'
)
 ORDER BY date desc LIMIT 0, 50
050909 17:38:44

contact/view/cd

1) 3 Query       SELECT  id, title  FROM civicrm_group  WHERE  civicrm_group.domain_id = 1 AND  civicrm_group.is_active = 1    ORDER BY title
		      
2) 3 Query       SELECT count(DISTINCT civicrm_contact.id) 
        FROM civicrm_contact 
WHERE civicrm_contact.id = 42 AND  ( 1 )
		      		      
3) 3 Query       SELECT    civicrm_contact.display_name as display_name,
          civicrm_contact.contact_type as contact_type,
          civicrm_email.email          as email       
FROM      civicrm_contact
LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
                               civicrm_contact.id = civicrm_location.entity_id AND
                               civicrm_location.is_primary = 1)
LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
WHERE     civicrm_contact.id = 42
		      		      
4) 3 Query       SELECT  id, contact_type  FROM civicrm_contact  WHERE  civicrm_contact.id = 42
		      		      		      
5) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Inline' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight, title
		      		      		      
6) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Tab' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight
		      	      		      
7) 3 Query       SELECT  id, name  FROM civicrm_activity_type  WHERE id > 3 AND  civicrm_activity_type.domain_id = 1 AND  civicrm_activity_type.is_active = 1    ORDER BY name
050909 17:47:58	      
		      		      
8) 3 Query       SELECT  id, contact_type  FROM civicrm_contact  WHERE  civicrm_contact.id = 21
		      		      		      
9) 3 Query       SELECT civicrm_custom_field.id as civicrm_custom_field_id, civicrm_custom_field.name as civicrm_custom_field_name, civicrm_custom_field.label as civicrm_custom_field_label, civicrm_custom_field.data_type as civicrm_custom_field_data_type, civicrm_custom_field.html_type as civicrm_custom_field_html_type, civicrm_custom_field.default_value as civicrm_custom_field_default_value, civicrm_custom_field.attributes as civicrm_custom_field_attributes, civicrm_custom_field.is_required as civicrm_custom_field_is_required, civicrm_custom_field.help_post as civicrm_custom_field_help_post, civicrm_custom_field.options_per_line as civicrm_custom_field_options_per_line, civicrm_custom_group.id as civicrm_custom_group_id, civicrm_custom_group.title as civicrm_custom_group_title, civicrm_custom_group.help_pre as civicrm_custom_group_help_pre, civicrm_custom_group.collapse_display as civicrm_custom_group_collapse_display, civicrm_custom_value.id as civicrm_custom_value_id, civicrm_custom_value.int_data as civicrm_custom_value_int_data, civicrm_custom_value.float_data as civicrm_custom_value_float_data, civicrm_custom_value.decimal_data as civicrm_custom_value_decimal_data, civicrm_custom_value.char_data as civicrm_custom_value_char_data, civicrm_custom_value.date_data as civicrm_custom_value_date_data, civicrm_custom_value.memo_data as civicrm_custom_value_memo_data FROM civicrm_custom_group LEFT JOIN civicrm_custom_field ON (civicrm_custom_field.custom_group_id = civicrm_custom_group.id) LEFT JOIN civicrm_custom_value ON (civicrm_custom_value.custom_field_id = civicrm_custom_field.id 
                                                     AND civicrm_custom_value.entity_table = 'civicrm_contact' 
                                                     AND civicrm_custom_value.entity_id = 42) WHERE civicrm_custom_group.is_active = 1 AND civicrm_custom_field.is_active = 1 AND civicrm_custom_group.extends IN ('Individual', 'Contact') AND civicrm_custom_group.id = 1 AND civicrm_custom_group.style = 'Tab' ORDER BY civicrm_custom_group.weight, civicrm_custom_field.weight
		      
10) 3 Query       SELECT * FROM civicrm_custom_field  WHERE  civicrm_custom_field.id = 1
		      		      		      
11) 3 Query       SELECT * FROM civicrm_custom_field  WHERE  civicrm_custom_field.id = 2
		      	      		      
12) 3 Query       SELECT * FROM civicrm_custom_field  WHERE  civicrm_custom_field.id = 3
		      		      		      
13) 3 Query       SELECT * FROM civicrm_custom_field  WHERE  civicrm_custom_field.id = 4

contact/view/group

1) 3 Query       SELECT  id, title  FROM civicrm_group  WHERE  civicrm_group.domain_id = 1 AND  civicrm_group.is_active = 1    ORDER BY title
		      		      
2) 3 Query       SELECT count(DISTINCT civicrm_contact.id) 
        FROM civicrm_contact 
WHERE civicrm_contact.id = 21 AND  ( 1 )
		      		      		      
3) 3 Query       SELECT    civicrm_contact.display_name as display_name,
          civicrm_contact.contact_type as contact_type,
          civicrm_email.email          as email       
FROM      civicrm_contact
LEFT JOIN civicrm_location ON (civicrm_location.entity_table = 'civicrm_contact' AND
                               civicrm_contact.id = civicrm_location.entity_id AND
                               civicrm_location.is_primary = 1)
LEFT JOIN civicrm_email ON (civicrm_location.id = civicrm_email.location_id AND civicrm_email.is_primary = 1)
WHERE     civicrm_contact.id = 21
		      		      		      
4) 3 Query       SELECT  id, contact_type  FROM civicrm_contact  WHERE  civicrm_contact.id = 21
		      		      		      		      
5) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Inline' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight, title
		      		      		      		      
6) 3 Query       SELECT * FROM civicrm_custom_group  WHERE style = 'Tab' AND is_active = 1 AND extends IN ('Contact', 'Individual')    ORDER BY weight
		      		      	      		      
7) 3 Query       SELECT  id, name  FROM civicrm_activity_type  WHERE id > 3 AND  civicrm_activity_type.domain_id = 1 AND  civicrm_activity_type.is_active = 1    ORDER BY name
		      		      		      
8) 3 Query       SELECT civicrm_group.id, civicrm_group.title  FROM civicrm_group, civicrm_group_contact  WHERE civicrm_group.is_active = 1  AND civicrm_group.id = civicrm_group_contact.group_id 
                        AND civicrm_group_contact.contact_id = 21 ORDER BY civicrm_group.name
		      		      		      		      
9) 3 Query       SELECT count(DISTINCT civicrm_group_contact.id) FROM civicrm_contact  LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id  LEFT JOIN civicrm_group ON civicrm_group.id =  civicrm_group_contact.group_id  LEFT JOIN civicrm_subscription_history
                                   ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
                                  AND civicrm_group_contact.group_id   =  civicrm_subscription_history.group_id WHERE civicrm_contact.id = 21 AND civicrm_group.is_active = '1'  AND  ( 1 )
		      		      
10) 3 Query       SELECT 
                    civicrm_group_contact.id as civicrm_group_contact_id, 
                    civicrm_group.title as group_title,
                    civicrm_group_contact.status as status, 
                    civicrm_group.id as group_id,
                    civicrm_subscription_history.date as date,
                    civicrm_subscription_history.method as method FROM civicrm_contact  LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id  LEFT JOIN civicrm_group ON civicrm_group.id =  civicrm_group_contact.group_id  LEFT JOIN civicrm_subscription_history
                                   ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
                                  AND civicrm_group_contact.group_id   =  civicrm_subscription_history.group_id WHERE civicrm_contact.id = 21 AND civicrm_group.is_active = '1'  AND civicrm_group_contact.status = "Added" AND  ( 1 )   ORDER BY civicrm_group.title
		      
11) 3 Query       SELECT 
                    civicrm_group_contact.id as civicrm_group_contact_id, 
                    civicrm_group.title as group_title,
                    civicrm_group_contact.status as status, 
                    civicrm_group.id as group_id,
                    civicrm_subscription_history.date as date,
                    civicrm_subscription_history.method as method FROM civicrm_contact  LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id  LEFT JOIN civicrm_group ON civicrm_group.id =  civicrm_group_contact.group_id  LEFT JOIN civicrm_subscription_history
                                   ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
                                  AND civicrm_group_contact.group_id   =  civicrm_subscription_history.group_id WHERE civicrm_contact.id = 21 AND civicrm_group.is_active = '1'  AND civicrm_group_contact.status = "Pending" AND  ( 1 )   ORDER BY civicrm_group.title
		      
		      	      		      		      
12) 3 Query       SELECT 
                    civicrm_group_contact.id as civicrm_group_contact_id, 
                    civicrm_group.title as group_title,
                    civicrm_group_contact.status as status, 
                    civicrm_group.id as group_id,
                    civicrm_subscription_history.date as date,
                    civicrm_subscription_history.method as method FROM civicrm_contact  LEFT JOIN civicrm_group_contact ON civicrm_contact.id = civicrm_group_contact.contact_id  LEFT JOIN civicrm_group ON civicrm_group.id =  civicrm_group_contact.group_id  LEFT JOIN civicrm_subscription_history
                                   ON civicrm_group_contact.contact_id = civicrm_subscription_history.contact_id
                                  AND civicrm_group_contact.group_id   =  civicrm_subscription_history.group_id WHERE civicrm_contact.id = 21 AND civicrm_group.is_active = '1'  AND civicrm_group_contact.status = "Removed" AND  ( 1 )   ORDER BY civicrm_group.title

hey manish:

can u give us an idea how u did the above analysis. aalso for some of the queries with higher numbers, can we get a breakdown

Powered by a free Atlassian Confluence Open Source Project License granted to CiviCRM . Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators