[freeside-commits] branch master updated. 05056204cf2fb1b216480bf242e9fdc00a3148f6

Ivan ivan at 420.am
Tue Sep 2 10:21:22 PDT 2014


The branch, master has been updated
       via  05056204cf2fb1b216480bf242e9fdc00a3148f6 (commit)
       via  3317a32f572a2e3605071410e7ddd8082e0b03ee (commit)
      from  b95c330fd8e0acde52b6743274fa003f821a84ef (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 05056204cf2fb1b216480bf242e9fdc00a3148f6
Merge: b95c330 3317a32f
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Sep 2 10:21:15 2014 -0700

    Merge branch 'h_cust_main_index_fix' of https://github.com/Jayceh/Freeside


commit 3317a32f572a2e3605071410e7ddd8082e0b03ee
Author: Jason (Jayce^) Hall <jayce at lug-nut.com>
Date:   Tue Sep 2 11:00:08 2014 -0600

    Add in history_usernum and history_username indices. This allows for
    searches on *who* made changes to run faster. The best example of this
    is on the homepage when it looks for the last modified customers by the
    current user. On our system that query could take 5 minutes across so
    many history records. Now takes a manageable amount of time with this
    index

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 2aba2ea..c635ea0 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -243,6 +243,23 @@ sub dbdef_dist {
                         ],
          });
 
+ 	#necessary for queries that want to look at *who* made changes
+      $h_indices{"h_${table}_usernum"} =
+         DBIx::DBSchema::Index->new({
+           'name'    => "h_${table}_usernum",
+           'unique'  => 0,
+           'columns' => [ 'history_usernum'],
+         });
+
+ 	# necessary because of the evil OR username for older data, be really nice if everything was just migrated to usernum and we could drop username
+	# This will not be helpful to mysql, but postgres smartly does a bitmap across both indexes, mysql will just use one
+
+      $h_indices{"h_${table}_username"} =
+         DBIx::DBSchema::Index->new({
+           'name'    => "h_${table}_username",
+           'unique'  => 0,
+           'columns' => [ 'history_username'],
+         });
     }
 
     my $primary_key_col = $tableobj->column($tableobj->primary_key)

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Schema.pm |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)




More information about the freeside-commits mailing list