Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21677 - reduce unnecessary address joins on activity & contact detail reports #11855

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 22, 2018

Overview

Improve efficiency of joins in these reports

  • Contact Detail
  • Contact Summary
  • Activity Summary
  • Activity Detail

Before

unnecessary joins to phone, email and address tables

After

join only when needed, code standardised

Technical Details

This also aligns the approach with that used in the extended report extension - there might be some notices as I have updated the extension where the signature differs from core but will need to drop a new release & people will need to be on it.

Comments

Sub-commit of #11814 which in itself is a reviewer's cut of #11550 - I have just included the files for changes for 3 reports here

In order to get the first chunk reviewed & merged (as I fear #11814 will languish due to the number of reports affected)

@yashodha hoping you can review & merge this or that @jitendrapurohit can review to get your original PR cleared away


ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND
{$this->_aliases['civicrm_phone']}.is_primary = 1 ";
}
$this->joinPhoneFromClause();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be joinPhoneFromContact()?

ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND
{$this->_aliases['civicrm_email']}.is_primary = 1 ";
}
$this->joinEmailFromClause();
Copy link
Contributor

@jitendrapurohit jitendrapurohit Mar 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another typo - should be joinEmailFromContact()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ug I took from the wrong version! That was one of the things I fixed when I did my cut
https://github.com/civicrm/civicrm-core/pull/11814/files#diff-35417c3a249b354869b9e25ca48e9d5cR585

@eileenmcnaughton
Copy link
Contributor Author

@jitendrapurohit fixed now - right version of those changes, one more report in the commit too now

Copy link
Contributor

@jitendrapurohit jitendrapurohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the functionality of all the modified reports. They seem to be working fine 👍

@eileenmcnaughton
Copy link
Contributor Author

thanks @jitendrapurohit - I'll merge once tests complete then & rebase these changes out of the main PR with these changes

@eileenmcnaughton eileenmcnaughton merged commit f3e2844 into civicrm:master Mar 22, 2018
@eileenmcnaughton eileenmcnaughton deleted the report_min branch March 22, 2018 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants