LCOV - code coverage report
Current view: top level - monetdb5/optimizer - opt_fastpath.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 55 0.0 %
Date: 2021-10-13 02:24:04 Functions: 0 2 0.0 %

          Line data    Source code
       1             : /*
       2             :  * This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       5             :  *
       6             :  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
       7             :  */
       8             : 
       9             : #include "monetdb_config.h"
      10             : #include "opt_fastpath.h"
      11             : #include "opt_aliases.h"
      12             : #include "opt_bincopyfrom.h"
      13             : #include "opt_coercion.h"
      14             : #include "opt_commonTerms.h"
      15             : #include "opt_candidates.h"
      16             : #include "opt_constants.h"
      17             : #include "opt_costModel.h"
      18             : #include "opt_dataflow.h"
      19             : #include "opt_deadcode.h"
      20             : #include "opt_emptybind.h"
      21             : #include "opt_evaluate.h"
      22             : #include "opt_garbageCollector.h"
      23             : #include "opt_generator.h"
      24             : #include "opt_inline.h"
      25             : #include "opt_jit.h"
      26             : #include "opt_projectionpath.h"
      27             : #include "opt_matpack.h"
      28             : #include "opt_json.h"
      29             : #include "opt_oltp.h"
      30             : #include "opt_postfix.h"
      31             : #include "opt_mask.h"
      32             : #include "opt_mergetable.h"
      33             : #include "opt_mitosis.h"
      34             : #include "opt_multiplex.h"
      35             : #include "opt_profiler.h"
      36             : #include "opt_pushselect.h"
      37             : #include "opt_querylog.h"
      38             : #include "opt_reduce.h"
      39             : #include "opt_remap.h"
      40             : #include "opt_remoteQueries.h"
      41             : #include "opt_reorder.h"
      42             : #include "opt_volcano.h"
      43             : #include "opt_fastpath.h"
      44             : #include "opt_wlc.h"
      45             : #include "optimizer_private.h"
      46             : #include "mal_interpreter.h"
      47             : #include "mal_profiler.h"
      48             : #include "opt_prelude.h"
      49             : 
      50             : str
      51           0 : OPTminimalfastImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
      52             : {
      53             :         int actions = 0;
      54             :         str msg = MAL_SUCCEED;
      55             :         InstrPtr q;
      56             :         int i, bincopy = 0, generator = 0, multiplex = 0;
      57             : 
      58             :         (void)cntxt;
      59             :         (void)stk;
      60             : 
      61             :         /* perform a single scan through the plan to determine which optimizer steps to skip */
      62           0 :         for( i=0; i<mb->stop; i++){
      63           0 :                 q = getInstrPtr(mb,i);
      64           0 :                 if (q->modname == sqlRef && q->fcnname == importTableRef) 
      65             :                         bincopy= 1;
      66           0 :                 if( getModuleId(q) == generatorRef)
      67             :                         generator = 1;
      68           0 :                 if ( getFunctionId(q) == multiplexRef)
      69             :                         multiplex = 1;
      70             :         }
      71             : 
      72           0 :         msg = OPTinlineImplementation(cntxt, mb, stk, pci);
      73           0 :         if( msg == MAL_SUCCEED) msg = OPTremapImplementation(cntxt, mb, stk, pci);
      74           0 :         if( bincopy && msg == MAL_SUCCEED) msg = OPTbincopyfromImplementation(cntxt, mb, stk, pci);
      75           0 :         if( msg == MAL_SUCCEED) msg = OPTdeadcodeImplementation(cntxt, mb, stk, pci);
      76           0 :         if( multiplex && msg == MAL_SUCCEED) msg = OPTmultiplexImplementation(cntxt, mb, stk, pci);
      77           0 :         if( generator &&  msg == MAL_SUCCEED) msg = OPTgeneratorImplementation(cntxt, mb, stk, pci);
      78           0 :         if( malProfileMode &&  msg == MAL_SUCCEED) msg = OPTprofilerImplementation(cntxt, mb, stk, pci);
      79           0 :         if( malProfileMode &&  msg == MAL_SUCCEED) msg = OPTcandidatesImplementation(cntxt, mb, stk, pci);
      80           0 :         if( msg == MAL_SUCCEED) msg = OPTgarbageCollectorImplementation(cntxt, mb, stk, pci);
      81             : 
      82             :         /* Defense line against incorrect plans  handled by optimizer steps */
      83             :         /* keep actions taken as a fake argument*/
      84           0 :         (void) pushInt(mb, pci, actions);
      85           0 :         return msg;
      86             : }
      87             : 
      88             : str
      89           0 : OPTdefaultfastImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
      90             : {
      91             :         int actions = 0;
      92             :         str msg = MAL_SUCCEED;
      93             :         InstrPtr q;
      94             :         int i, bincopy = 0, generator = 0, multiplex = 0;
      95             : 
      96             :         (void)cntxt;
      97             :         (void)stk;
      98             : 
      99             : 
     100             :         /* perform a single scan through the plan to determine which optimizer steps to skip */
     101           0 :         for( i=0; i<mb->stop; i++){
     102           0 :                 q = getInstrPtr(mb,i);
     103           0 :                 if (q->modname == sqlRef && q->fcnname == importTableRef) 
     104             :                         bincopy= 1;
     105           0 :                 if( getModuleId(q) == generatorRef)
     106             :                         generator = 1;
     107           0 :                 if ( getFunctionId(q) == multiplexRef)
     108             :                         multiplex = 1;
     109             :         }
     110           0 :         msg = OPTinlineImplementation(cntxt, mb, stk, pci);
     111           0 :         if( msg == MAL_SUCCEED) msg = OPTremapImplementation(cntxt, mb, stk, pci);
     112           0 :         if( msg == MAL_SUCCEED) msg = OPTcostModelImplementation(cntxt, mb, stk, pci);
     113           0 :         if( msg == MAL_SUCCEED) msg = OPTcoercionImplementation(cntxt, mb, stk, pci);
     114           0 :         if( msg == MAL_SUCCEED) msg = OPTaliasesImplementation(cntxt, mb, stk, pci);
     115           0 :         if( msg == MAL_SUCCEED) msg = OPTevaluateImplementation(cntxt, mb, stk, pci);
     116           0 :         if( msg == MAL_SUCCEED) msg = OPTemptybindImplementation(cntxt, mb, stk, pci);
     117           0 :         if( msg == MAL_SUCCEED) msg = OPTdeadcodeImplementation(cntxt, mb, stk, pci);
     118           0 :         if( msg == MAL_SUCCEED) msg = OPTpushselectImplementation(cntxt, mb, stk, pci);
     119           0 :         if( msg == MAL_SUCCEED) msg = OPTaliasesImplementation(cntxt, mb, stk, pci);
     120           0 :         if( msg == MAL_SUCCEED) msg = OPTmitosisImplementation(cntxt, mb, stk, pci);
     121           0 :         if( msg == MAL_SUCCEED) msg = OPTmergetableImplementation(cntxt, mb, stk, pci);
     122           0 :         if( bincopy && msg == MAL_SUCCEED) msg = OPTbincopyfromImplementation(cntxt, mb, stk, pci);
     123           0 :         if( msg == MAL_SUCCEED) msg = OPTaliasesImplementation(cntxt, mb, stk, pci);
     124           0 :         if( msg == MAL_SUCCEED) msg = OPTconstantsImplementation(cntxt, mb, stk, pci);
     125           0 :         if( msg == MAL_SUCCEED) msg = OPTcommonTermsImplementation(cntxt, mb, stk, pci);
     126           0 :         if( msg == MAL_SUCCEED) msg = OPTprojectionpathImplementation(cntxt, mb, stk, pci);
     127           0 :         if( msg == MAL_SUCCEED) msg = OPTdeadcodeImplementation(cntxt, mb, stk, pci);
     128           0 :         if( msg == MAL_SUCCEED) msg = OPTreorderImplementation(cntxt, mb, stk, pci);
     129           0 :         if( msg == MAL_SUCCEED) msg = OPTmatpackImplementation(cntxt, mb, stk, pci);
     130           0 :         if( msg == MAL_SUCCEED) msg = OPTdataflowImplementation(cntxt, mb, stk, pci);
     131           0 :         if( msg == MAL_SUCCEED) msg = OPTquerylogImplementation(cntxt, mb, stk, pci);
     132           0 :         if( multiplex && msg == MAL_SUCCEED) msg = OPTmultiplexImplementation(cntxt, mb, stk, pci);
     133           0 :         if( generator && msg == MAL_SUCCEED) msg = OPTgeneratorImplementation(cntxt, mb, stk, pci);
     134           0 :         if( malProfileMode &&  msg == MAL_SUCCEED) msg = OPTprofilerImplementation(cntxt, mb, stk, pci);
     135           0 :         if( malProfileMode &&  msg == MAL_SUCCEED) msg = OPTcandidatesImplementation(cntxt, mb, stk, pci);
     136           0 :         if( msg == MAL_SUCCEED) msg = OPTdeadcodeImplementation(cntxt, mb, stk, pci);
     137           0 :         if( msg == MAL_SUCCEED) msg = OPTpostfixImplementation(cntxt, mb, stk, pci);
     138             :         // if( msg == MAL_SUCCEED) msg = OPTjitImplementation(cntxt, mb, stk, pci);
     139           0 :         if( msg == MAL_SUCCEED) msg = OPTwlcImplementation(cntxt, mb, stk, pci);
     140           0 :         if( msg == MAL_SUCCEED) msg = OPTgarbageCollectorImplementation(cntxt, mb, stk, pci);
     141             : 
     142             :         /* Defense line against incorrect plans  handled by optimizer steps */
     143             :         /* keep actions taken as a fake argument*/
     144           0 :         (void) pushInt(mb, pci, actions);
     145           0 :         return msg;
     146             : }

Generated by: LCOV version 1.14