| 846 | } |
| 847 | |
| 848 | void |
| 849 | standard_ExecutorRun(QueryDesc *queryDesc, |
| 850 | ScanDirection direction, uint64 count, bool execute_once) |
| 851 | { |
| 852 | EState *estate; |
| 853 | CmdType operation; |
| 854 | DestReceiver *dest; |
| 855 | bool sendTuples; |
| 856 | MemoryContext oldcontext; |
| 857 | bool endpointCreated = false; |
| 858 | uint64 es_processed = 0; |
| 859 | /* |
| 860 | * NOTE: Any local vars that are set in the PG_TRY block and examined in the |
| 861 | * PG_CATCH block should be declared 'volatile'. (setjmp shenanigans) |
| 862 | */ |
| 863 | ExecSlice *currentSlice; |
| 864 | GpExecIdentity exec_identity; |
| 865 | bool amIParallel = false; |
| 866 | |
| 867 | /* sanity checks */ |
| 868 | Assert(queryDesc != NULL); |
| 869 | |
| 870 | estate = queryDesc->estate; |
| 871 | |
| 872 | Assert(estate != NULL); |
| 873 | Assert(!(estate->es_top_eflags & EXEC_FLAG_EXPLAIN_ONLY)); |
| 874 | |
| 875 | /* |
| 876 | * Switch into per-query memory context |
| 877 | */ |
| 878 | oldcontext = MemoryContextSwitchTo(estate->es_query_cxt); |
| 879 | |
| 880 | /* Allow instrumentation of Executor overall runtime */ |
| 881 | if (queryDesc->totaltime) |
| 882 | InstrStartNode(queryDesc->totaltime); |
| 883 | |
| 884 | /* |
| 885 | * CDB: Update global slice id for log messages. |
| 886 | */ |
| 887 | currentSlice = getCurrentSlice(estate, LocallyExecutingSliceIndex(estate)); |
| 888 | if (currentSlice) |
| 889 | { |
| 890 | if (Gp_role == GP_ROLE_EXECUTE || |
| 891 | sliceRunsOnQD(currentSlice)) |
| 892 | { |
| 893 | currentSliceId = currentSlice->sliceIndex; |
| 894 | amIParallel = currentSlice->useMppParallelMode; |
| 895 | } |
| 896 | } |
| 897 | |
| 898 | /* |
| 899 | * extract information from the query descriptor and the query feature. |
| 900 | */ |
| 901 | operation = queryDesc->operation; |
| 902 | dest = queryDesc->dest; |
| 903 | |
| 904 | /* |
| 905 | * startup tuple receiver, if we will be emitting tuples |
no test coverage detected