Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
d035857f
Commit
d035857f
authored
4 years ago
by
eileen
Browse files
Options
Downloads
Patches
Plain Diff
Dedupe performance - hard-remove financial_item from list of dymnamic refs to contact tablge
parent
1bdf47d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Core/DAO.php
+0
-1
0 additions, 1 deletion
CRM/Core/DAO.php
CRM/Dedupe/MergeHandler.php
+7
-0
7 additions, 0 deletions
CRM/Dedupe/MergeHandler.php
with
7 additions
and
1 deletion
CRM/Core/DAO.php
+
0
−
1
View file @
d035857f
...
...
@@ -2401,7 +2401,6 @@ SELECT contact_id
$refsFound
=
[];
foreach
(
CRM_Core_DAO_AllCoreTables
::
getClasses
()
as
$daoClassName
)
{
$links
=
$daoClassName
::
getReferenceColumns
();
$daoTableName
=
$daoClassName
::
getTableName
();
foreach
(
$links
as
$refSpec
)
{
/** @var $refSpec CRM_Core_Reference_Interface */
...
...
This diff is collapsed.
Click to expand it.
CRM/Dedupe/MergeHandler.php
+
7
−
0
View file @
d035857f
...
...
@@ -124,6 +124,13 @@ class CRM_Dedupe_MergeHandler {
if
(
!
isset
(
\Civi
::
$statics
[
__CLASS__
][
'dynamic'
]))
{
\Civi
::
$statics
[
__CLASS__
][
'dynamic'
]
=
[];
foreach
(
CRM_Core_DAO
::
getDynamicReferencesToTable
(
'civicrm_contact'
)
as
$tableName
=>
$field
)
{
if
(
$tableName
===
'civicrm_financial_item'
)
{
// It turns out that civicrm_financial_item does not have an index on entity_table (only as the latter
// part of a entity_id/entity_table index which probably is not adding any value over & above entity_id
// only. This means this is a slow query. The correct fix is probably to add a whitelist to
// values for entity_table in the schema.
continue
;
}
$sql
[]
=
"(SELECT '
$tableName
' as civicrm_table, '
{
$field
[
0
]
}
' as field_name FROM
$tableName
WHERE entity_table = 'civicrm_contact' LIMIT 1)"
;
}
$sqlString
=
implode
(
' UNION '
,
$sql
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment