LCOV - code coverage report
Current view: top level - monetdb5/optimizer - opt_prelude.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 258 258 100.0 %
Date: 2024-11-13 22:44:48 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /*
       2             :  * SPDX-License-Identifier: MPL-2.0
       3             :  *
       4             :  * This Source Code Form is subject to the terms of the Mozilla Public
       5             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       6             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       7             :  *
       8             :  * Copyright 2024 MonetDB Foundation;
       9             :  * Copyright August 2008 - 2023 MonetDB B.V.;
      10             :  * Copyright 1997 - July 2008 CWI.
      11             :  */
      12             : 
      13             : /*
      14             :  * opt_prelude
      15             :  * M. Kersten
      16             :  * These definitions are handy to have around in the optimizer
      17             :  */
      18             : #include "monetdb_config.h"
      19             : #include "opt_prelude.h"
      20             : #include "optimizer_private.h"
      21             : 
      22             : /* ! please keep this list sorted for easier maintenance ! */
      23             : const char *affectedRowsRef;
      24             : const char *aggrRef;
      25             : const char *alarmRef;
      26             : const char *algebraRef;
      27             : const char *alter_add_range_partitionRef;
      28             : const char *alter_add_tableRef;
      29             : const char *alter_add_value_partitionRef;
      30             : const char *alter_del_tableRef;
      31             : const char *alter_seqRef;
      32             : const char *alter_set_tableRef;
      33             : const char *alter_tableRef;
      34             : const char *alter_userRef;
      35             : const char *appendBulkRef;
      36             : const char *appendRef;
      37             : const char *assertRef;
      38             : const char *avgRef;
      39             : const char *bandjoinRef;
      40             : const char *batalgebraRef;
      41             : const char *batcalcRef;
      42             : const char *batcapiRef;
      43             : const char *batmalRef;
      44             : const char *batmkeyRef;
      45             : const char *batmmathRef;
      46             : const char *batmtimeRef;
      47             : const char *batpyapi3Ref;
      48             : const char *batrapiRef;
      49             : const char *batRef;
      50             : const char *batsqlRef;
      51             : const char *batstrRef;
      52             : const char *bbpRef;
      53             : const char *betweenRef;
      54             : const char *binddbatRef;
      55             : const char *bindidxRef;
      56             : const char *bindRef;
      57             : const char *blockRef;
      58             : const char *bstreamRef;
      59             : const char *calcRef;
      60             : const char *capiRef;
      61             : const char *claimRef;
      62             : const char *clear_tableRef;
      63             : const char *columnBindRef;
      64             : const char *comment_onRef;
      65             : const char *compressRef;
      66             : const char *connectRef;
      67             : const char *containsRef;
      68             : const char *copy_fromRef;
      69             : const char *corrRef;
      70             : const char *count_no_nilRef;
      71             : const char *countRef;
      72             : const char *create_functionRef;
      73             : const char *create_roleRef;
      74             : const char *create_schemaRef;
      75             : const char *create_seqRef;
      76             : const char *create_tableRef;
      77             : const char *create_triggerRef;
      78             : const char *create_typeRef;
      79             : const char *create_userRef;
      80             : const char *create_viewRef;
      81             : const char *crossRef;
      82             : const char *cume_distRef;
      83             : const char *dataflowRef;
      84             : const char *dblRef;
      85             : const char *decompressRef;
      86             : const char *defineRef;
      87             : const char *deleteRef;
      88             : const char *deltaRef;
      89             : const char *dense_rankRef;
      90             : const char *dependRef;
      91             : const char *deregisterRef;
      92             : const char *dictRef;
      93             : const char *diffcandRef;
      94             : const char *differenceRef;
      95             : const char *disconnectRef;
      96             : const char *divRef;
      97             : const char *drop_constraintRef;
      98             : const char *drop_functionRef;
      99             : const char *drop_indexRef;
     100             : const char *drop_roleRef;
     101             : const char *drop_schemaRef;
     102             : const char *drop_seqRef;
     103             : const char *drop_tableRef;
     104             : const char *drop_triggerRef;
     105             : const char *drop_typeRef;
     106             : const char *drop_userRef;
     107             : const char *drop_viewRef;
     108             : const char *emptybindidxRef;
     109             : const char *emptybindRef;
     110             : const char *endswithjoinRef;
     111             : const char *eqRef;
     112             : const char *evalRef;
     113             : const char *execRef;
     114             : const char *export_bin_columnRef;
     115             : const char *exportOperationRef;
     116             : const char *export_tableRef;
     117             : const char *fetchRef;
     118             : const char *findRef;
     119             : const char *firstnRef;
     120             : const char *first_valueRef;
     121             : const char *forRef;
     122             : const char *generatorRef;
     123             : const char *getRef;
     124             : const char *getTraceRef;
     125             : const char *getVariableRef;
     126             : const char *grant_functionRef;
     127             : const char *grantRef;
     128             : const char *grant_rolesRef;
     129             : const char *groupbyRef;
     130             : const char *groupdoneRef;
     131             : const char *groupRef;
     132             : const char *growRef;
     133             : const char *hgeRef;
     134             : const char *identityRef;
     135             : const char *ifthenelseRef;
     136             : const char *importColumnRef;
     137             : const char *intersectcandRef;
     138             : const char *intersectRef;
     139             : const char *intRef;
     140             : const char *ioRef;
     141             : const char *iteratorRef;
     142             : const char *joinRef;
     143             : const char *jsonRef;
     144             : const char *lagRef;
     145             : const char *languageRef;
     146             : const char *last_valueRef;
     147             : const char *leadRef;
     148             : const char *leftjoinRef;
     149             : const char *likejoinRef;
     150             : const char *likeRef;
     151             : const char *likeselectRef;
     152             : const char *lngRef;
     153             : const char *lockRef;
     154             : const char *lookupRef;
     155             : const char *malRef;
     156             : const char *manifoldRef;
     157             : const char *mapiRef;
     158             : const char *markjoinRef;
     159             : const char *markselectRef;
     160             : const char *maskRef;
     161             : const char *matRef;
     162             : const char *maxlevenshteinRef;
     163             : const char *maxRef;
     164             : const char *mdbRef;
     165             : const char *mergecandRef;
     166             : const char *mergepackRef;
     167             : const char *mergetableRef;
     168             : const char *minjarowinklerRef;
     169             : const char *minRef;
     170             : const char *minusRef;
     171             : const char *mirrorRef;
     172             : const char *mitosisRef;
     173             : const char *mmathRef;
     174             : const char *modRef;
     175             : const char *mtimeRef;
     176             : const char *mulRef;
     177             : const char *multiplexRef;
     178             : const char *mvcRef;
     179             : const char *newRef;
     180             : const char *nextRef;
     181             : const char *not_likeRef;
     182             : const char *notRef;
     183             : const char *not_uniqueRef;
     184             : const char *nth_valueRef;
     185             : const char *ntileRef;
     186             : const char *outercrossRef;
     187             : const char *outerjoinRef;
     188             : const char *outerselectRef;
     189             : const char *packIncrementRef;
     190             : const char *packRef;
     191             : const char *parametersRef;
     192             : const char *passRef;
     193             : const char *percent_rankRef;
     194             : const char *plusRef;
     195             : const char *predicateRef;
     196             : const char *printRef;
     197             : const char *prodRef;
     198             : const char *profilerRef;
     199             : const char *projectdeltaRef;
     200             : const char *projectionpathRef;
     201             : const char *projectionRef;
     202             : const char *projectRef;
     203             : const char *putRef;
     204             : const char *pyapi3Ref;
     205             : const char *querylogRef;
     206             : const char *raiseRef;
     207             : const char *rangejoinRef;
     208             : const char *rankRef;
     209             : const char *rapiRef;
     210             : const char *reconnectRef;
     211             : const char *registerRef;
     212             : const char *register_supervisorRef;
     213             : const char *remapRef;
     214             : const char *remoteRef;
     215             : const char *rename_columnRef;
     216             : const char *rename_schemaRef;
     217             : const char *rename_tableRef;
     218             : const char *rename_userRef;
     219             : const char *renumberRef;
     220             : const char *replaceRef;
     221             : const char *resultSetRef;
     222             : const char *revoke_functionRef;
     223             : const char *revokeRef;
     224             : const char *revoke_rolesRef;
     225             : const char *row_numberRef;
     226             : const char *rpcRef;
     227             : const char *rsColumnRef;
     228             : const char *rtreeRef;
     229             : const char *sampleRef;
     230             : const char *selectNotNilRef;
     231             : const char *selectRef;
     232             : const char *semaRef;
     233             : const char *semijoinRef;
     234             : const char *seriesRef;
     235             : const char *setAccessRef;
     236             : const char *set_protocolRef;
     237             : const char *setVariableRef;
     238             : const char *singleRef;
     239             : const char *sliceRef;
     240             : const char *sortRef;
     241             : const char *sqlcatalogRef;
     242             : const char *sqlRef;
     243             : const char *startswithjoinRef;
     244             : const char *stoptraceRef;
     245             : const char *streamsRef;
     246             : const char *strimpsRef;
     247             : const char *strRef;
     248             : const char *subavgRef;
     249             : const char *subcountRef;
     250             : const char *subdeltaRef;
     251             : const char *subeval_aggrRef;
     252             : const char *subgroupdoneRef;
     253             : const char *subgroupRef;
     254             : const char *submaxRef;
     255             : const char *subminRef;
     256             : const char *subprodRef;
     257             : const char *subsliceRef;
     258             : const char *subsumRef;
     259             : const char *subuniformRef;
     260             : const char *sumRef;
     261             : const char *takeRef;
     262             : const char *thetajoinRef;
     263             : const char *thetaselectRef;
     264             : const char *tidRef;
     265             : const char *transaction_abortRef;
     266             : const char *transaction_beginRef;
     267             : const char *transaction_commitRef;
     268             : const char *transactionRef;
     269             : const char *transaction_releaseRef;
     270             : const char *transaction_rollbackRef;
     271             : const char *umaskRef;
     272             : const char *unionfuncRef;
     273             : const char *uniqueRef;
     274             : const char *unlockRef;
     275             : const char *updateRef;
     276             : const char *userRef;
     277             : const char *window_boundRef;
     278             : const char *zero_or_oneRef;
     279             : /* ! please keep this list sorted for easier maintenance ! */
     280             : 
     281             : void
     282         315 : optimizerInit(void)
     283             : {
     284             : /* ! please keep this list sorted for easier maintenance ! */
     285         315 :         affectedRowsRef = putName("affectedRows");
     286         315 :         aggrRef = putName("aggr");
     287         315 :         alarmRef = putName("alarm");
     288         315 :         algebraRef = putName("algebra");
     289         315 :         alter_add_range_partitionRef = putName("alter_add_range_partition");
     290         315 :         alter_add_tableRef = putName("alter_add_table");
     291         315 :         alter_add_value_partitionRef = putName("alter_add_value_partition");
     292         315 :         alter_del_tableRef = putName("alter_del_table");
     293         315 :         alter_seqRef = putName("alter_seq");
     294         315 :         alter_set_tableRef = putName("alter_set_table");
     295         315 :         alter_tableRef = putName("alter_table");
     296         315 :         alter_userRef = putName("alter_user");
     297         315 :         appendBulkRef = putName("appendBulk");
     298         315 :         appendRef = putName("append");
     299         315 :         assertRef = putName("assert");
     300         315 :         avgRef = putName("avg");
     301         315 :         bandjoinRef = putName("bandjoin");
     302         315 :         batalgebraRef = putName("batalgebra");
     303         315 :         batcalcRef = putName("batcalc");
     304         315 :         batcapiRef = putName("batcapi");
     305         315 :         batmalRef = putName("batmal");
     306         315 :         batmkeyRef = putName("batmkey");
     307         315 :         batmmathRef = putName("batmmath");
     308         315 :         batmtimeRef = putName("batmtime");
     309         315 :         batpyapi3Ref = putName("batpyapi3");
     310         315 :         batrapiRef = putName("batrapi");
     311         315 :         batRef = putName("bat");
     312         315 :         batsqlRef = putName("batsql");
     313         315 :         batstrRef = putName("batstr");
     314         315 :         bbpRef = putName("bbp");
     315         315 :         betweenRef = putName("between");
     316         315 :         binddbatRef = putName("bind_dbat");
     317         315 :         bindidxRef = putName("bind_idxbat");
     318         315 :         bindRef = putName("bind");
     319         315 :         blockRef = putName("block");
     320         315 :         bstreamRef = putName("bstream");
     321         315 :         calcRef = putName("calc");
     322         315 :         capiRef = putName("capi");
     323         315 :         claimRef = putName("claim");
     324         315 :         clear_tableRef = putName("clear_table");
     325         315 :         columnBindRef = putName("columnBind");
     326         315 :         comment_onRef = putName("comment_on");
     327         315 :         compressRef = putName("compress");
     328         315 :         connectRef = putName("connect");
     329         315 :         containsRef = putName("contains");
     330         315 :         copy_fromRef = putName("copy_from");
     331         315 :         corrRef = putName("corr");
     332         315 :         count_no_nilRef = putName("count_no_nil");
     333         315 :         countRef = putName("count");
     334         315 :         create_functionRef = putName("create_function");
     335         315 :         create_roleRef = putName("create_role");
     336         315 :         create_schemaRef = putName("create_schema");
     337         315 :         create_seqRef = putName("create_seq");
     338         315 :         create_tableRef = putName("create_table");
     339         315 :         create_triggerRef = putName("create_trigger");
     340         315 :         create_typeRef = putName("create_type");
     341         315 :         create_userRef = putName("create_user");
     342         315 :         create_viewRef = putName("create_view");
     343         315 :         crossRef = putName("crossproduct");
     344         315 :         cume_distRef = putName("cume_dist");
     345         315 :         dataflowRef = putName("dataflow");
     346         315 :         dblRef = putName("dbl");
     347         315 :         decompressRef = putName("decompress");
     348         315 :         defineRef = putName("define");
     349         315 :         deleteRef = putName("delete");
     350         315 :         deltaRef = putName("delta");
     351         315 :         dense_rankRef = putName("dense_rank");
     352         315 :         dependRef = putName("depend");
     353         315 :         deregisterRef = putName("deregister");
     354         315 :         dictRef = putName("dict");
     355         315 :         diffcandRef = putName("diffcand");
     356         315 :         differenceRef = putName("difference");
     357         315 :         disconnectRef = putName("disconnect");
     358         315 :         divRef = putName("/");
     359         315 :         drop_constraintRef = putName("drop_constraint");
     360         315 :         drop_functionRef = putName("drop_function");
     361         315 :         drop_indexRef = putName("drop_index");
     362         315 :         drop_roleRef = putName("drop_role");
     363         315 :         drop_schemaRef = putName("drop_schema");
     364         315 :         drop_seqRef = putName("drop_seq");
     365         315 :         drop_tableRef = putName("drop_table");
     366         315 :         drop_triggerRef = putName("drop_trigger");
     367         315 :         drop_typeRef = putName("drop_type");
     368         315 :         drop_userRef = putName("drop_user");
     369         315 :         drop_viewRef = putName("drop_view");
     370         315 :         emptybindidxRef = putName("emptybindidx");
     371         315 :         emptybindRef = putName("emptybind");
     372         315 :         endswithjoinRef = putName("endswithjoin");
     373         315 :         eqRef = putName("==");
     374         315 :         evalRef = putName("eval");
     375         315 :         execRef = putName("exec");
     376         315 :         export_bin_columnRef = "export_bin_column";
     377         315 :         exportOperationRef = putName("exportOperation");
     378         315 :         export_tableRef = putName("export_table");
     379         315 :         fetchRef = putName("fetch");
     380         315 :         findRef = putName("find");
     381         315 :         firstnRef = putName("firstn");
     382         315 :         first_valueRef = putName("first_value");
     383         315 :         forRef = putName("for");
     384         315 :         generatorRef = putName("generator");
     385         315 :         getRef = putName("get");
     386         315 :         getTraceRef = putName("getTrace");
     387         315 :         getVariableRef = putName("getVariable");
     388         315 :         grant_functionRef = putName("grant_function");
     389         315 :         grantRef = putName("grant");
     390         315 :         grant_rolesRef = putName("grant_roles");
     391         315 :         groupbyRef = putName("groupby");
     392         315 :         groupdoneRef = putName("groupdone");
     393         315 :         groupRef = putName("group");
     394         315 :         growRef = putName("grow");
     395         315 :         hgeRef = putName("hge");
     396         315 :         identityRef = putName("identity");
     397         315 :         ifthenelseRef = putName("ifthenelse");
     398         315 :         importColumnRef = putName("importColumn");
     399         315 :         intersectcandRef = putName("intersectcand");
     400         315 :         intersectRef = putName("intersect");
     401         315 :         intRef = putName("int");
     402         315 :         ioRef = putName("io");
     403         315 :         iteratorRef = putName("iterator");
     404         315 :         joinRef = putName("join");
     405         315 :         jsonRef = putName("json");
     406         315 :         lagRef = putName("lag");
     407         315 :         languageRef = putName("language");
     408         315 :         last_valueRef = putName("last_value");
     409         315 :         leadRef = putName("lead");
     410         315 :         leftjoinRef = putName("leftjoin");
     411         315 :         likejoinRef = putName("likejoin");
     412         315 :         likeRef = putName("like");
     413         315 :         likeselectRef = putName("likeselect");
     414         315 :         lngRef = putName("lng");
     415         315 :         lockRef = putName("lock");
     416         315 :         lookupRef = putName("lookup");
     417         315 :         malRef = putName("mal");
     418         315 :         manifoldRef = putName("manifold");
     419         315 :         mapiRef = putName("mapi");
     420         315 :         markjoinRef = putName("markjoin");
     421         315 :         markselectRef = putName("markselect");
     422         315 :         maskRef = putName("mask");
     423         315 :         matRef = putName("mat");
     424         315 :         maxlevenshteinRef = putName("maxlevenshtein");
     425         315 :         maxRef = putName("max");
     426         315 :         mdbRef = putName("mdb");
     427         315 :         mergecandRef = putName("mergecand");
     428         315 :         mergepackRef = putName("mergepack");
     429         315 :         mergetableRef = putName("mergetable");
     430         315 :         minjarowinklerRef = putName("minjarowinkler");
     431         315 :         minRef = putName("min");
     432         315 :         minusRef = putName("-");
     433         315 :         mirrorRef = putName("mirror");
     434         315 :         mitosisRef = putName("mitosis");
     435         315 :         mmathRef = putName("mmath");
     436         315 :         modRef = putName("%");
     437         315 :         mtimeRef = putName("mtime");
     438         315 :         mulRef = putName("*");
     439         315 :         multiplexRef = putName("multiplex");
     440         315 :         mvcRef = putName("mvc");
     441         315 :         newRef = putName("new");
     442         315 :         nextRef = putName("next");
     443         315 :         not_likeRef = putName("not_like");
     444         315 :         notRef = putName("not");
     445         315 :         not_uniqueRef = putName("not_unique");
     446         315 :         nth_valueRef = putName("nth_value");
     447         315 :         ntileRef = putName("ntile");
     448         315 :         outercrossRef = putName("outercrossproduct");
     449         315 :         outerjoinRef = putName("outerjoin");
     450         315 :         outerselectRef = putName("outerselect");
     451         315 :         packIncrementRef = putName("packIncrement");
     452         315 :         packRef = putName("pack");
     453         315 :         parametersRef = putName("parameters");
     454         315 :         passRef = putName("pass");
     455         315 :         percent_rankRef = putName("percent_rank");
     456         315 :         plusRef = putName("+");
     457         315 :         predicateRef = putName("predicate");
     458         315 :         printRef = putName("print");
     459         315 :         prodRef = putName("prod");
     460         315 :         profilerRef = putName("profiler");
     461         315 :         projectdeltaRef = putName("projectdelta");
     462         315 :         projectionpathRef = putName("projectionpath");
     463         315 :         projectionRef = putName("projection");
     464         315 :         projectRef = putName("project");
     465         315 :         putRef = putName("put");
     466         315 :         pyapi3Ref = putName("pyapi3");
     467         315 :         querylogRef = putName("querylog");
     468         315 :         raiseRef = putName("raise");
     469         315 :         rangejoinRef = putName("rangejoin");
     470         315 :         rankRef = putName("rank");
     471         315 :         rapiRef = putName("rapi");
     472         315 :         reconnectRef = putName("reconnect");
     473         315 :         registerRef = putName("register");
     474         315 :         register_supervisorRef = putName("register_supervisor");
     475         315 :         remapRef = putName("remap");
     476         315 :         remoteRef = putName("remote");
     477         315 :         rename_columnRef = putName("rename_column");
     478         315 :         rename_schemaRef = putName("rename_schema");
     479         315 :         rename_tableRef = putName("rename_table");
     480         315 :         rename_userRef = putName("rename_user");
     481         315 :         renumberRef = putName("renumber");
     482         315 :         replaceRef = putName("replace");
     483         315 :         resultSetRef = putName("resultSet");
     484         315 :         revoke_functionRef = putName("revoke_function");
     485         315 :         revokeRef = putName("revoke");
     486         315 :         revoke_rolesRef = putName("revoke_roles");
     487         315 :         row_numberRef = putName("row_number");
     488         315 :         rpcRef = putName("rpc");
     489         315 :         rsColumnRef = putName("rsColumn");
     490         315 :         rtreeRef = putName("rtree");
     491         315 :         sampleRef = putName("sample");
     492         315 :         selectNotNilRef = putName("selectNotNil");
     493         315 :         selectRef = putName("select");
     494         315 :         semaRef = putName("sema");
     495         315 :         semijoinRef = putName("semijoin");
     496         315 :         seriesRef = putName("series");
     497         315 :         setAccessRef = putName("setAccess");
     498         315 :         set_protocolRef = putName("set_protocol");
     499         315 :         setVariableRef = putName("setVariable");
     500         315 :         singleRef = putName("single");
     501         315 :         sliceRef = putName("slice");
     502         315 :         sortRef = putName("sort");
     503         315 :         sqlcatalogRef = putName("sqlcatalog");
     504         315 :         sqlRef = putName("sql");
     505         315 :         startswithjoinRef = putName("startswithjoin");
     506         315 :         stoptraceRef = putName("stoptrace");
     507         315 :         streamsRef = putName("streams");
     508         315 :         strimpsRef = putName("strimps");
     509         315 :         strRef = putName("str");
     510         315 :         subavgRef = putName("subavg");
     511         315 :         subcountRef = putName("subcount");
     512         315 :         subdeltaRef = putName("subdelta");
     513         315 :         subeval_aggrRef = putName("subeval_aggr");
     514         315 :         subgroupdoneRef = putName("subgroupdone");
     515         315 :         subgroupRef = putName("subgroup");
     516         315 :         submaxRef = putName("submax");
     517         315 :         subminRef = putName("submin");
     518         315 :         subprodRef = putName("subprod");
     519         315 :         subsliceRef = putName("subslice");
     520         315 :         subsumRef = putName("subsum");
     521         315 :         subuniformRef = putName("subuniform");
     522         315 :         sumRef = putName("sum");
     523         315 :         takeRef = putName("take");
     524         315 :         thetajoinRef = putName("thetajoin");
     525         315 :         thetaselectRef = putName("thetaselect");
     526         315 :         tidRef = putName("tid");
     527         315 :         transaction_abortRef = putName("transaction_abort");
     528         315 :         transaction_beginRef = putName("transaction_begin");
     529         315 :         transaction_commitRef = putName("transaction_commit");
     530         315 :         transactionRef = putName("transaction");
     531         315 :         transaction_releaseRef = putName("transaction_release");
     532         315 :         transaction_rollbackRef = putName("transaction_rollback");
     533         315 :         umaskRef = putName("umask");
     534         315 :         unionfuncRef = putName("unionfunc");
     535         315 :         uniqueRef = putName("unique");
     536         315 :         unlockRef = putName("unlock");
     537         315 :         updateRef = putName("update");
     538         315 :         userRef = putName("user");
     539         315 :         window_boundRef = putName("window_bound");
     540         315 :         zero_or_oneRef = putName("zero_or_one");
     541             : /* ! please keep this list sorted for easier maintenance ! */
     542         315 : }

Generated by: LCOV version 1.14