MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecInitRangeTable

Function ExecInitRangeTable

src/backend/executor/execUtils.c:807–830  ·  view source on GitHub ↗

* ExecInitRangeTable * Set up executor's range-table-related data * * In addition to the range table proper, initialize arrays that are * indexed by rangetable index. */

Source from the content-addressed store, hash-verified

805 * indexed by rangetable index.
806 */
807void
808ExecInitRangeTable(EState *estate, List *rangeTable)
809{
810 /* Remember the range table List as-is */
811 estate->es_range_table = rangeTable;
812
813 /* Set size of associated arrays */
814 estate->es_range_table_size = list_length(rangeTable);
815
816 /*
817 * Allocate an array to store an open Relation corresponding to each
818 * rangetable entry, and initialize entries to NULL. Relations are opened
819 * and stored here as needed.
820 */
821 estate->es_relations = (Relation *)
822 palloc0(estate->es_range_table_size * sizeof(Relation));
823
824 /*
825 * es_result_relations and es_rowmarks are also parallel to
826 * es_range_table, but are allocated only if needed.
827 */
828 estate->es_result_relations = NULL;
829 estate->es_rowmarks = NULL;
830}
831
832/*
833 * ExecGetRangeTableRelation

Callers 4

CopyFromDirectoryTableFunction · 0.85
CopyFromFunction · 0.85
InitPlanFunction · 0.85

Calls 2

list_lengthFunction · 0.85
palloc0Function · 0.50

Tested by

no test coverage detected