[freeside-commits] branch master updated. 707368aa7db1cecdd05b74c8531249a1e1370823
Ivan
ivan at 420.am
Tue Nov 18 11:41:40 PST 2014
The branch, master has been updated
via 707368aa7db1cecdd05b74c8531249a1e1370823 (commit)
via 6bead8d6f196872b9863aa902341697b43a5b067 (commit)
from 5ed43cea286d5fab10db1cfdc4fa80b99b203ab9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 707368aa7db1cecdd05b74c8531249a1e1370823
Merge: 6bead8d 5ed43ce
Author: Ivan Kohler <ivan at freeside.biz>
Date: Tue Nov 18 11:41:35 2014 -0800
Merge branch 'master' of git.freeside.biz:/home/git/freeside
commit 6bead8d6f196872b9863aa902341697b43a5b067
Author: Ivan Kohler <ivan at freeside.biz>
Date: Tue Nov 18 11:41:28 2014 -0800
optimize history search (invoice rending time for svc_ records with tons of changes), RT#32190
diff --git a/FS/FS/h_Common.pm b/FS/FS/h_Common.pm
index 9b5ad09..87fb76d 100644
--- a/FS/FS/h_Common.pm
+++ b/FS/FS/h_Common.pm
@@ -52,19 +52,19 @@ sub sql_h_search {
my( $notdeleted, $notdeleted_mr ) = ( '', '' );
if ( scalar(@_) && $_[0] ) {
$notdeleted =
- "AND 0 = ( SELECT COUNT(*) FROM $table as notdel
- WHERE notdel.$pkey = maintable.$pkey
- AND notdel.history_action = 'delete'
- AND notdel.history_date > maintable.history_date
- AND notdel.history_date <= $_[0]
- )";
+ "AND NOT EXISTS ( SELECT 1 FROM $table as notdel
+ WHERE notdel.$pkey = maintable.$pkey
+ AND notdel.history_action = 'delete'
+ AND notdel.history_date > maintable.history_date
+ AND notdel.history_date <= $_[0]
+ )";
$notdeleted_mr =
- "AND 0 = ( SELECT COUNT(*) FROM $table as notdel_mr
- WHERE notdel_mr.$pkey = mostrecent.$pkey
- AND notdel_mr.history_action = 'delete'
- AND notdel_mr.history_date > mostrecent.history_date
- AND notdel_mr.history_date <= $_[0]
- )";
+ "AND NOT EXISTS ( SELECT 1 FROM $table as notdel_mr
+ WHERE notdel_mr.$pkey = mostrecent.$pkey
+ AND notdel_mr.history_action = 'delete'
+ AND notdel_mr.history_date > mostrecent.history_date
+ AND notdel_mr.history_date <= $_[0]
+ )";
}
(
-----------------------------------------------------------------------
Summary of changes:
FS/FS/h_Common.pm | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
More information about the freeside-commits
mailing list