!2676 支持or表达式的谓词提取下推

Merge pull request !2676 from 陈志凯/master
This commit is contained in:
opengauss-bot
2022-12-23 06:47:32 +00:00
committed by Gitee
15 changed files with 493 additions and 207 deletions

View File

@ -20,6 +20,8 @@
#include "nodes/nodeFuncs.h"
#ifndef ENABLE_MULTIPLE_NODES
#define is_andclause(clause) \
((clause) != NULL && IsA(clause, BoolExpr) && (((const BoolExpr *)(clause))->boolop) == AND_EXPR)
#define is_orclause(clause) \
((clause) != NULL && IsA(clause, BoolExpr) && (((const BoolExpr *)(clause))->boolop) == OR_EXPR)
#define is_notclause(clause) \

View File

@ -0,0 +1,21 @@
/*-------------------------------------------------------------------------
*
* orclauses.h
* prototypes for orclauses.c.
*
* Portions Copyright (c) 2022, openGauss Contributors
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/optimizer/orclauses.h
*
*-------------------------------------------------------------------------
*/
#ifndef ORCLAUSES_H
#define ORCLAUSES_H
#include "nodes/relation.h"
extern void extract_restriction_or_clauses(PlannerInfo *root);
#endif /* ORCLAUSES_H */

View File

@ -79,13 +79,6 @@ inline bool CheckIndexPathUseGPI(IndexPath* ipath)
return ipath->indexinfo->isGlobal;
}
/*
* orindxpath.c
* additional routines for indexable OR clauses
*/
extern bool create_or_index_quals(PlannerInfo* root, RelOptInfo* rel);
/*
* tidpath.h
* routines to generate tid paths

View File

@ -418,7 +418,8 @@ typedef enum {
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 */
DISABLE_BITMAP_COST_WITH_LOSSY_PAGES = 32768, /* stop computing bitmap path cost with lossy pages */
EXTRACT_PUSHDOWN_OR_CLAUSE = 65536 /* Extract restriction OR clauses. */
} sql_beta_param;
typedef enum {