From c2029091f6d643b9ae5f1ad303eaa4c28ed88ab2 Mon Sep 17 00:00:00 2001 From: xiyanziran Date: Mon, 30 Jan 2023 00:56:36 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=E5=B0=86=E6=9E=9A=E4=B8=BE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8Brewrite=5Fparam=E5=92=8Csql=5Fbeta=5Fparam=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=94=B9=E4=B8=BA=E6=9B=B4=E5=AE=B9=E6=98=93=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/utils/guc.h | 54 ++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 7de2545d3..35052b608 100755 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -389,37 +389,37 @@ typedef enum { typedef enum { NO_REWRITE = 0, /* not allow lazy agg and magic set rewrite*/ - LAZY_AGG = 1, /* allow lazy agg */ - MAGIC_SET = 2, /* allow query qual push */ - PARTIAL_PUSH = 4, /* allow partial push */ - SUBLINK_PULLUP_WITH_UNIQUE_CHECK = 8, /* allow pull sublink with unqiue check */ - SUBLINK_PULLUP_DISABLE_REPLICATED = 16, /* disable pull up sublink with replicated table */ - SUBLINK_PULLUP_IN_TARGETLIST = 32, /* allow pull sublink in targetlist */ - PRED_PUSH = 64, /* push predicate into subquery block */ - PRED_PUSH_NORMAL = 128, - PRED_PUSH_FORCE = 256, - SUBLINK_PULLUP_DISABLE_EXPR = 512, /* disable pull sublink in expr clause */ + LAZY_AGG = (1<<0), /* allow lazy agg */ + MAGIC_SET = (1<<1), /* allow query qual push */ + PARTIAL_PUSH = (1<<2), /* allow partial push */ + SUBLINK_PULLUP_WITH_UNIQUE_CHECK = (1<<3), /* allow pull sublink with unqiue check */ + SUBLINK_PULLUP_DISABLE_REPLICATED = (1<<4), /* disable pull up sublink with replicated table */ + SUBLINK_PULLUP_IN_TARGETLIST = (1<<5), /* allow pull sublink in targetlist */ + PRED_PUSH = (1<<6), /* push predicate into subquery block */ + PRED_PUSH_NORMAL = (1<<7), + PRED_PUSH_FORCE = (1<<8), + SUBLINK_PULLUP_DISABLE_EXPR = (1<<9), /* disable pull sublink in expr clause */ } rewrite_param; typedef enum { NO_BETA_FEATURE = 0, - SEL_SEMI_POISSON = 1, /* use poisson distribution model to calibrate semi join selectivity */ - SEL_EXPR_INSTR = 2, /* use pattern sel to calibrate instr() related base rel selectivity */ - PARAM_PATH_GEN = 4, /* Parametrized Path Generation */ - RAND_COST_OPT = 8, /* Optimizing sc_random_page_cost */ - PARAM_PATH_OPT = 16, /* Parametrized Path Optimization. */ - PAGE_EST_OPT = 32, /* More accurate (rowstored) index pages estimation */ - NO_UNIQUE_INDEX_FIRST = 64, /* use unique index first rule in path generation */ - JOIN_SEL_WITH_CAST_FUNC = 128, /* support cast function while calculating join selectivity */ - CANONICAL_PATHKEY = 256, /* Use canonicalize pathkeys directly */ - INDEX_COST_WITH_LEAF_PAGES_ONLY = 512, /* compute index cost with consideration of leaf-pages-only */ - PARTITION_OPFUSION = 1024, /* Enable partition opfusion */ - A_STYLE_COERCE = 2048, - PLPGSQL_STREAM_FETCHALL = 4096, /* fetch all tuple when has stream sql under plpgsql's for-loop */ - PREDPUSH_SAME_LEVEL = 8192, /* predpush same level */ - PARTITION_FDW_ON = 16384, /* support create foreign table on partitioned table */ - DISABLE_BITMAP_COST_WITH_LOSSY_PAGES = 32768, /* stop computing bitmap path cost with lossy pages */ - EXTRACT_PUSHDOWN_OR_CLAUSE = 65536 /* Extract restriction OR clauses. */ + SEL_SEMI_POISSON = (1<<0), /* use poisson distribution model to calibrate semi join selectivity */ + SEL_EXPR_INSTR = (1<<1), /* use pattern sel to calibrate instr() related base rel selectivity */ + PARAM_PATH_GEN = (1<<2), /* Parametrized Path Generation */ + RAND_COST_OPT = (1<<3), /* Optimizing sc_random_page_cost */ + PARAM_PATH_OPT = (1<<4), /* Parametrized Path Optimization. */ + PAGE_EST_OPT = (1<<5), /* More accurate (rowstored) index pages estimation */ + NO_UNIQUE_INDEX_FIRST = (1<<6), /* use unique index first rule in path generation */ + JOIN_SEL_WITH_CAST_FUNC = (1<<7), /* support cast function while calculating join selectivity */ + CANONICAL_PATHKEY = (1<<8), /* Use canonicalize pathkeys directly */ + INDEX_COST_WITH_LEAF_PAGES_ONLY = (1<<9), /* compute index cost with consideration of leaf-pages-only */ + PARTITION_OPFUSION = (1<<10), /* Enable partition opfusion */ + A_STYLE_COERCE = (1<<11), + PLPGSQL_STREAM_FETCHALL = (1<<12), /* fetch all tuple when has stream sql under plpgsql's for-loop */ + PREDPUSH_SAME_LEVEL = (1<<13), /* predpush same level */ + PARTITION_FDW_ON = (1<<14), /* support create foreign table on partitioned table */ + DISABLE_BITMAP_COST_WITH_LOSSY_PAGES = (1<<15), /* stop computing bitmap path cost with lossy pages */ + EXTRACT_PUSHDOWN_OR_CLAUSE = (1<<16) /* Extract restriction OR clauses. */ } sql_beta_param; typedef enum { From ae11b9a547651a0dbdc033a7aab672aa1eef6876 Mon Sep 17 00:00:00 2001 From: xiyanziran Date: Mon, 4 Sep 2023 02:41:05 +0000 Subject: [PATCH 2/2] update src/include/utils/guc.h. Signed-off-by: xiyanziran --- src/include/utils/guc.h | 56 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 2b1b1ea08..acd92a165 100755 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -389,38 +389,38 @@ typedef enum { typedef enum { NO_REWRITE = 0, /* not allow lazy agg and magic set rewrite*/ - LAZY_AGG = (1<<0), /* allow lazy agg */ - MAGIC_SET = (1<<1), /* allow query qual push */ - PARTIAL_PUSH = (1<<2), /* allow partial push */ - SUBLINK_PULLUP_WITH_UNIQUE_CHECK = (1<<3), /* allow pull sublink with unqiue check */ - SUBLINK_PULLUP_DISABLE_REPLICATED = (1<<4), /* disable pull up sublink with replicated table */ - SUBLINK_PULLUP_IN_TARGETLIST = (1<<5), /* allow pull sublink in targetlist */ - PRED_PUSH = (1<<6), /* push predicate into subquery block */ - PRED_PUSH_NORMAL = (1<<7), - PRED_PUSH_FORCE = (1<<8), - SUBLINK_PULLUP_DISABLE_EXPR = (1<<9), /* disable pull sublink in expr clause */ - SUBLINK_PULLUP_ENHANCED = (1<<10) + LAZY_AGG = (1 << 0), /* allow lazy agg */ + MAGIC_SET = (1 << 1), /* allow query qual push */ + PARTIAL_PUSH = (1 << 2), /* allow partial push */ + SUBLINK_PULLUP_WITH_UNIQUE_CHECK = (1 << 3), /* allow pull sublink with unqiue check */ + SUBLINK_PULLUP_DISABLE_REPLICATED = (1 << 4), /* disable pull up sublink with replicated table */ + SUBLINK_PULLUP_IN_TARGETLIST = (1 << 5), /* allow pull sublink in targetlist */ + PRED_PUSH = (1 << 6), /* push predicate into subquery block */ + PRED_PUSH_NORMAL = (1 << 7), + PRED_PUSH_FORCE = (1 << 8), + SUBLINK_PULLUP_DISABLE_EXPR = (1 << 9), /* disable pull sublink in expr clause */ + SUBLINK_PULLUP_ENHANCED = (1 << 10) } rewrite_param; typedef enum { NO_BETA_FEATURE = 0, - SEL_SEMI_POISSON = (1<<0), /* use poisson distribution model to calibrate semi join selectivity */ - SEL_EXPR_INSTR = (1<<1), /* use pattern sel to calibrate instr() related base rel selectivity */ - PARAM_PATH_GEN = (1<<2), /* Parametrized Path Generation */ - RAND_COST_OPT = (1<<3), /* Optimizing sc_random_page_cost */ - PARAM_PATH_OPT = (1<<4), /* Parametrized Path Optimization. */ - PAGE_EST_OPT = (1<<5), /* More accurate (rowstored) index pages estimation */ - NO_UNIQUE_INDEX_FIRST = (1<<6), /* use unique index first rule in path generation */ - JOIN_SEL_WITH_CAST_FUNC = (1<<7), /* support cast function while calculating join selectivity */ - CANONICAL_PATHKEY = (1<<8), /* Use canonicalize pathkeys directly */ - INDEX_COST_WITH_LEAF_PAGES_ONLY = (1<<9), /* compute index cost with consideration of leaf-pages-only */ - PARTITION_OPFUSION = (1<<10), /* Enable partition opfusion */ - A_STYLE_COERCE = (1<<11), - PLPGSQL_STREAM_FETCHALL = (1<<12), /* fetch all tuple when has stream sql under plpgsql's for-loop */ - PREDPUSH_SAME_LEVEL = (1<<13), /* predpush same level */ - PARTITION_FDW_ON = (1<<14), /* support create foreign table on partitioned table */ - DISABLE_BITMAP_COST_WITH_LOSSY_PAGES = (1<<15), /* stop computing bitmap path cost with lossy pages */ - EXTRACT_PUSHDOWN_OR_CLAUSE = (1<<16) /* Extract restriction OR clauses. */ + SEL_SEMI_POISSON = (1 << 0), /* use poisson distribution model to calibrate semi join selectivity */ + SEL_EXPR_INSTR = (1 << 1), /* use pattern sel to calibrate instr() related base rel selectivity */ + PARAM_PATH_GEN = (1 << 2), /* Parametrized Path Generation */ + RAND_COST_OPT = (1 << 3), /* Optimizing sc_random_page_cost */ + PARAM_PATH_OPT = (1 << 4), /* Parametrized Path Optimization. */ + PAGE_EST_OPT = (1 << 5), /* More accurate (rowstored) index pages estimation */ + NO_UNIQUE_INDEX_FIRST = (1 << 6), /* use unique index first rule in path generation */ + JOIN_SEL_WITH_CAST_FUNC = (1 << 7), /* support cast function while calculating join selectivity */ + CANONICAL_PATHKEY = (1 << 8), /* Use canonicalize pathkeys directly */ + INDEX_COST_WITH_LEAF_PAGES_ONLY = (1 << 9), /* compute index cost with consideration of leaf-pages-only */ + PARTITION_OPFUSION = (1 << 10), /* Enable partition opfusion */ + A_STYLE_COERCE = (1 << 11), + PLPGSQL_STREAM_FETCHALL = (1 << 12), /* fetch all tuple when has stream sql under plpgsql's for-loop */ + PREDPUSH_SAME_LEVEL = (1 << 13), /* predpush same level */ + PARTITION_FDW_ON = (1 << 14), /* support create foreign table on partitioned table */ + DISABLE_BITMAP_COST_WITH_LOSSY_PAGES = (1 << 15), /* stop computing bitmap path cost with lossy pages */ + EXTRACT_PUSHDOWN_OR_CLAUSE = (1 << 16) /* Extract restriction OR clauses. */ } sql_beta_param; typedef enum {