Skip to content

Commit d245ec4

Browse files
committed
rename to DeferredChunkScan
1 parent 136fab4 commit d245ec4

14 files changed

Lines changed: 202 additions & 168 deletions

File tree

src/cross_module_fn.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ typedef struct CrossModuleFunctions
8080
void (*set_rel_pathlist_query)(PlannerInfo *, RelOptInfo *, Index, RangeTblEntry *,
8181
Hypertable *);
8282

83-
bool (*should_hypertable_scan)(const Query *query, const Hypertable *ht);
84-
void (*hypertable_scan_add_path)(PlannerInfo *root, RelOptInfo *rel, const Hypertable *ht);
83+
bool (*should_deferred_chunk_scan)(const Query *query, const Hypertable *ht);
84+
void (*deferred_chunk_scan_add_path)(PlannerInfo *root, RelOptInfo *rel, const Hypertable *ht);
8585

8686
/* gapfill */
8787
PGFunction gapfill_marker;

src/guc.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bool ts_guc_enable_parallel_chunk_append = true;
9595
bool ts_guc_enable_runtime_exclusion = true;
9696
bool ts_guc_enable_constraint_exclusion = true;
9797
bool ts_guc_enable_hypertable_expansion_for_dml = true;
98-
TSDLLEXPORT bool ts_guc_enable_hypertablescan = false;
98+
TSDLLEXPORT bool ts_guc_enable_deferredchunkscan = false;
9999
bool ts_guc_enable_qual_propagation = true;
100100
TSDLLEXPORT bool ts_guc_enable_columnar_scan_filter_pushdown = true;
101101
bool ts_guc_enable_qual_filtering = true;
@@ -213,7 +213,7 @@ DebugRequireOption ts_guc_debug_require_vector_qual = DRO_Allow;
213213

214214
DebugRequireOption ts_guc_debug_require_vector_agg = DRO_Allow;
215215

216-
DebugRequireOption ts_guc_debug_require_hypertable_scan = DRO_Allow;
216+
DebugRequireOption ts_guc_debug_require_deferred_chunk_scan = DRO_Allow;
217217
#endif
218218

219219
DebugRequireOption ts_guc_debug_require_batch_sorted_merge = DRO_Allow;
@@ -781,11 +781,11 @@ _guc_init(void)
781781
NULL,
782782
NULL);
783783

784-
DefineCustomBoolVariable(MAKE_EXTOPTION("enable_hypertablescan"),
785-
"Enable HypertableScan for LIMIT queries",
784+
DefineCustomBoolVariable(MAKE_EXTOPTION("enable_deferredchunkscan"),
785+
"Enable DeferredChunkScan for LIMIT queries",
786786
"Custom scan node for hypertables that iterates chunks at"
787787
"execution instead of expanding every chunk at plan time.",
788-
&ts_guc_enable_hypertablescan,
788+
&ts_guc_enable_deferredchunkscan,
789789
false,
790790
PGC_USERSET,
791791
0,
@@ -1726,14 +1726,14 @@ _guc_init(void)
17261726
/* assign_hook= */ NULL,
17271727
/* show_hook= */ NULL);
17281728

1729-
DefineCustomEnumVariable(/* name= */ MAKE_EXTOPTION("debug_require_hypertable_scan"),
1729+
DefineCustomEnumVariable(/* name= */ MAKE_EXTOPTION("debug_require_deferred_chunk_scan"),
17301730
/* short_desc= */
1731-
"ensure that HypertableScan is used or not",
1731+
"ensure that DeferredChunkScan is used or not",
17321732
/* long_desc= */
17331733
"this is for debugging purposes, to check whether a query uses the "
1734-
"HypertableScan node without depending on version-specific EXPLAIN "
1734+
"DeferredChunkScan node without depending on version-specific EXPLAIN "
17351735
"output",
1736-
/* valueAddr= */ (int *) &ts_guc_debug_require_hypertable_scan,
1736+
/* valueAddr= */ (int *) &ts_guc_debug_require_deferred_chunk_scan,
17371737
/* bootValue= */ DRO_Allow,
17381738
/* options = */ debug_require_options,
17391739
/* context= */ PGC_USERSET,

src/guc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern bool ts_guc_enable_qual_filtering;
2828
extern bool ts_guc_enable_runtime_exclusion;
2929
extern bool ts_guc_enable_constraint_exclusion;
3030
extern bool ts_guc_enable_hypertable_expansion_for_dml;
31-
extern TSDLLEXPORT bool ts_guc_enable_hypertablescan;
31+
extern TSDLLEXPORT bool ts_guc_enable_deferredchunkscan;
3232
extern bool ts_guc_enable_cagg_reorder_groupby;
3333
extern TSDLLEXPORT bool ts_guc_enable_cagg_window_functions;
3434
extern TSDLLEXPORT bool ts_guc_skip_cagg_invalidation;
@@ -151,7 +151,7 @@ extern TSDLLEXPORT DebugRequireOption ts_guc_debug_require_vector_qual;
151151

152152
extern TSDLLEXPORT DebugRequireOption ts_guc_debug_require_vector_agg;
153153

154-
extern TSDLLEXPORT DebugRequireOption ts_guc_debug_require_hypertable_scan;
154+
extern TSDLLEXPORT DebugRequireOption ts_guc_debug_require_deferred_chunk_scan;
155155

156156
#endif
157157

src/planner/planner.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,11 +1497,11 @@ timescaledb_set_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, Index rti, Rang
14971497
reltype = ts_classify_relation(root, rel, &ht);
14981498

14991499
/*
1500-
* Attach HypertableScan path for the (unexpanded) hypertable.
1500+
* Attach DeferredChunkScan path for the (unexpanded) hypertable.
15011501
*/
1502-
if (reltype == TS_REL_HYPERTABLE && ht && ts_get_private_reloptinfo(rel)->hypertable_scan)
1502+
if (reltype == TS_REL_HYPERTABLE && ht && ts_get_private_reloptinfo(rel)->deferred_chunk_scan)
15031503
{
1504-
ts_cm_functions->hypertable_scan_add_path(root, rel, ht);
1504+
ts_cm_functions->deferred_chunk_scan_add_path(root, rel, ht);
15051505
if (prev_set_rel_pathlist_hook != NULL)
15061506
{
15071507
(*prev_set_rel_pathlist_hook)(root, rel, rti, rte);
@@ -1635,7 +1635,7 @@ timescaledb_get_relation_info(PlannerInfo *root, RelOptInfo *rel, bool inhparent
16351635
* including the target relation. The support for expanding target
16361636
* relation of MERGE is not implemented at the moment.
16371637
*
1638-
* For HypertableScan we don't expand during planning.
1638+
* For DeferredChunkScan we don't expand during planning.
16391639
*
16401640
* The hypertables that are not expanded by our custom code here
16411641
* fall back to the standard Postgres inheritance hierarchy
@@ -1644,9 +1644,9 @@ timescaledb_get_relation_info(PlannerInfo *root, RelOptInfo *rel, bool inhparent
16441644
* `inhparent` goes to false in two cases: a hypertable without
16451645
* chunks or a SELECT FROM ONLY hypertable.
16461646
*/
1647-
bool use_hypertable_scan = inhparent && ts_cm_functions->should_hypertable_scan &&
1648-
ts_cm_functions->should_hypertable_scan(query, ht);
1649-
if (use_hypertable_scan)
1647+
bool use_deferred_chunk_scan = inhparent && ts_cm_functions->should_deferred_chunk_scan &&
1648+
ts_cm_functions->should_deferred_chunk_scan(query, ht);
1649+
if (use_deferred_chunk_scan)
16501650
{
16511651
rte->inh = false;
16521652
}
@@ -1663,7 +1663,7 @@ timescaledb_get_relation_info(PlannerInfo *root, RelOptInfo *rel, bool inhparent
16631663
}
16641664
}
16651665

1666-
ts_create_private_reloptinfo(rel)->hypertable_scan = use_hypertable_scan;
1666+
ts_create_private_reloptinfo(rel)->deferred_chunk_scan = use_deferred_chunk_scan;
16671667

16681668
if (ts_guc_enable_optimizations)
16691669
{

src/planner/planner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ typedef struct TimescaleDBPrivate
4545
List *transformed_sort_pathkeys;
4646
bool transformed_sort_pathkeys_valid;
4747

48-
/* Use HypertableScan for this relation */
49-
bool hypertable_scan;
48+
/* Use DeferredChunkScan for this relation */
49+
bool deferred_chunk_scan;
5050
} TimescaleDBPrivate;
5151

5252
extern TSDLLEXPORT bool ts_rte_is_hypertable(const RangeTblEntry *rte);

tsl/src/init.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#include "nodes/columnar_index_scan/columnar_index_scan.h"
4444
#include "nodes/columnar_scan/planner.h"
4545
#include "nodes/gapfill/gapfill_functions.h"
46-
#include "nodes/hypertable_scan/hypertable_scan.h"
46+
#include "nodes/deferred_chunk_scan/deferred_chunk_scan.h"
4747
#include "nodes/skip_scan/skip_scan.h"
4848
#include "nodes/vector_agg/plan.h"
4949
#include "planner.h"
@@ -71,8 +71,8 @@ CrossModuleFunctions tsl_cm_functions = {
7171
.create_upper_paths_hook = tsl_create_upper_paths_hook,
7272
.set_rel_pathlist_dml = tsl_set_rel_pathlist_dml,
7373
.set_rel_pathlist_query = tsl_set_rel_pathlist_query,
74-
.should_hypertable_scan = ts_should_hypertable_scan,
75-
.hypertable_scan_add_path = ts_hypertable_scan_add_path,
74+
.should_deferred_chunk_scan = ts_should_deferred_chunk_scan,
75+
.deferred_chunk_scan_add_path = ts_deferred_chunk_scan_add_path,
7676

7777
/* bgw policies */
7878
.policy_compression_add = policy_compression_add,
@@ -221,7 +221,7 @@ ts_module_init(PG_FUNCTION_ARGS)
221221
_continuous_aggs_cache_inval_init();
222222
_columnar_index_scan_init();
223223
_columnar_scan_init();
224-
_hypertable_scan_init();
224+
_deferred_chunk_scan_init();
225225
_skip_scan_init();
226226
_vector_agg_init();
227227

tsl/src/nodes/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ target_sources(${TSL_LIBRARY_NAME} PRIVATE ${SOURCES})
33
add_subdirectory(columnar_index_scan)
44
add_subdirectory(columnar_scan)
55
add_subdirectory(gapfill)
6-
add_subdirectory(hypertable_scan)
6+
add_subdirectory(deferred_chunk_scan)
77
add_subdirectory(skip_scan)
88
add_subdirectory(vector_agg)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/deferred_chunk_scan.c)
2+
target_sources(${TSL_LIBRARY_NAME} PRIVATE ${SOURCES})

0 commit comments

Comments
 (0)