improve performance of CDR queries, RT#73889
[freeside.git] / FS / FS / Schema.pm
index f8b82f4..1630f02 100644 (file)
@@ -3248,6 +3248,7 @@ sub tables_hashref {
         'adjourn_months', 'int',    'NULL', '', '', '',
         'contract_end_months','int','NULL', '', '', '',
         'change_to_pkgpart', 'int', 'NULL', '', '', '',
+        'units_taxproductnum','int','NULL', '', '', '',
       ],
       'primary_key'  => 'pkgpart',
       'unique'       => [],
@@ -3265,6 +3266,10 @@ sub tables_hashref {
                           { columns    => [ 'taxproductnum' ],
                             table      => 'part_pkg_taxproduct',
                           },
+                          { columns    => [ 'units_taxproductnum' ],
+                            table      => 'part_pkg_taxproduct',
+                            references => [ 'taxproductnum' ],
+                          },
                           { columns    => [ 'agentnum' ],
                             table      => 'agent',
                           },
@@ -5616,6 +5621,8 @@ sub tables_hashref {
       'unique' => [],
       'index' => [ [ 'calldate' ],
                    [ 'src' ], [ 'dst' ], [ 'dcontext' ], [ 'charged_party' ],
+                   [ 'startdate' ], [ 'duration' ],
+                   [ 'cdrtypenum' ], [ 'calltypenum' ],
                    [ 'lastapp' ],
                    ['accountcode'], ['uniqueid'], ['carrierid'], ['cdrid'],
                    [ 'sessionnum' ], [ 'subscriber' ],