A table function calls FNC_GetPhaseEx before doing anything else.
Although FNC_GetPhaseEx can be used successfully by a table function that is passed in constant arguments (where the return value of FNC_GetPhaseEx is TBL_MODE_CONST), it is most useful to a table function that is passed in variable arguments (where the return value of FNC_GetPhaseEx is TBL_MODE_VARY).
The functionality that FNC_GetPhaseEx provides complements the HASH BY and LOCAL ORDER BY clauses that order input to table functions. For an example on how to order input arguments to a table function, see Ordering Input Arguments to Table UDFs.
FNC_GetPhaseEx also provides users with more control of table phase transitions when developing table functions. Users can reduce the number of phase transitions required during execution of a table function, thus reducing the number of UDF invocations and improving table function performance.