@@ -95,6 +95,7 @@ bool ts_guc_enable_parallel_chunk_append = true;
9595bool ts_guc_enable_runtime_exclusion = true;
9696bool ts_guc_enable_constraint_exclusion = true;
9797bool ts_guc_enable_hypertable_expansion_for_dml = true;
98+ TSDLLEXPORT bool ts_guc_enable_deferredchunkscan = false;
9899bool ts_guc_enable_qual_propagation = true;
99100TSDLLEXPORT bool ts_guc_enable_columnar_scan_filter_pushdown = true;
100101bool ts_guc_enable_qual_filtering = true;
@@ -211,6 +212,8 @@ bool ts_guc_debug_have_int128;
211212DebugRequireOption ts_guc_debug_require_vector_qual = DRO_Allow ;
212213
213214DebugRequireOption ts_guc_debug_require_vector_agg = DRO_Allow ;
215+
216+ DebugRequireOption ts_guc_debug_require_deferred_chunk_scan = DRO_Allow ;
214217#endif
215218
216219DebugRequireOption ts_guc_debug_require_batch_sorted_merge = DRO_Allow ;
@@ -778,6 +781,18 @@ _guc_init(void)
778781 NULL ,
779782 NULL );
780783
784+ DefineCustomBoolVariable (MAKE_EXTOPTION ("enable_deferredchunkscan" ),
785+ "Enable DeferredChunkScan for LIMIT queries" ,
786+ "Custom scan node for hypertables that iterates chunks at"
787+ "execution instead of expanding every chunk at plan time." ,
788+ & ts_guc_enable_deferredchunkscan ,
789+ false,
790+ PGC_USERSET ,
791+ 0 ,
792+ NULL ,
793+ NULL ,
794+ NULL );
795+
781796 DefineCustomBoolVariable (MAKE_EXTOPTION ("enable_foreign_key_propagation" ),
782797 "Enable foreign key propagation" ,
783798 "Adjust foreign key lookup queries to target whole hypertable" ,
@@ -1711,6 +1726,22 @@ _guc_init(void)
17111726 /* assign_hook= */ NULL ,
17121727 /* show_hook= */ NULL );
17131728
1729+ DefineCustomEnumVariable (/* name= */ MAKE_EXTOPTION ("debug_require_deferred_chunk_scan" ),
1730+ /* short_desc= */
1731+ "ensure that DeferredChunkScan is used or not" ,
1732+ /* long_desc= */
1733+ "this is for debugging purposes, to check whether a query uses the "
1734+ "DeferredChunkScan node without depending on version-specific EXPLAIN "
1735+ "output" ,
1736+ /* valueAddr= */ (int * ) & ts_guc_debug_require_deferred_chunk_scan ,
1737+ /* bootValue= */ DRO_Allow ,
1738+ /* options = */ debug_require_options ,
1739+ /* context= */ PGC_USERSET ,
1740+ /* flags= */ 0 ,
1741+ /* check_hook= */ NULL ,
1742+ /* assign_hook= */ NULL ,
1743+ /* show_hook= */ NULL );
1744+
17141745#endif
17151746
17161747 /* register feature flags */
0 commit comments