Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
61f621b5
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
61f621b5
编写于
1月 31, 2007
作者:
T
Teodor Sigaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert gincostestimate changes.
上级
b62f8569
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
1 addition
and
115 deletion
+1
-115
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+1
-115
未找到文件。
src/backend/utils/adt/selfuncs.c
浏览文件 @
61f621b5
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.22
4 2007/01/31 15:09:45
teodor Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.22
5 2007/01/31 16:54:51
teodor Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -76,7 +76,6 @@
#include <ctype.h>
#include <math.h>
#include "access/gin.h"
#include "catalog/pg_opfamily.h"
#include "catalog/pg_statistic.h"
#include "catalog/pg_type.h"
...
...
@@ -5287,119 +5286,6 @@ gincostestimate(PG_FUNCTION_ARGS)
Cost
*
indexTotalCost
=
(
Cost
*
)
PG_GETARG_POINTER
(
5
);
Selectivity
*
indexSelectivity
=
(
Selectivity
*
)
PG_GETARG_POINTER
(
6
);
double
*
indexCorrelation
=
(
double
*
)
PG_GETARG_POINTER
(
7
);
ListCell
*
l
;
int32
nfullscan
=
0
;
/*
* GIN doesn't support full index scan.
* If quals require full index scan then we should
* return cost big as possible to forbid full index scan.
*/
foreach
(
l
,
indexQuals
)
{
RestrictInfo
*
rinfo
=
(
RestrictInfo
*
)
lfirst
(
l
);
Expr
*
clause
;
Node
*
leftop
,
*
rightop
,
*
operand
;
Oid
extractProcOid
;
Oid
clause_op
;
int
strategy_op
;
Oid
lefttype
,
righttype
;
bool
recheck
;
int32
nentries
;
/*
* For each clause it's needed to check operand
* for values to search in GIN. So, we should find
* extractQuery method to get values from operand
*/
Assert
(
IsA
(
rinfo
,
RestrictInfo
));
clause
=
rinfo
->
clause
;
Assert
(
IsA
(
clause
,
OpExpr
)
);
leftop
=
get_leftop
(
clause
);
rightop
=
get_rightop
(
clause
);
clause_op
=
((
OpExpr
*
)
clause
)
->
opno
;
if
(
match_index_to_operand
(
leftop
,
0
/* GiN has only one column */
,
index
))
{
operand
=
rightop
;
}
else
if
(
match_index_to_operand
(
rightop
,
0
,
index
))
{
operand
=
leftop
;
clause_op
=
get_commutator
(
clause_op
);
}
if
(
IsA
(
operand
,
RelabelType
)
)
operand
=
(
Node
*
)
((
RelabelType
*
)
operand
)
->
arg
;
/*
* It's impossible to call extractQuery method for not yet
* known operand (taken from table, for example). In this
* case we can't do anything useful...
*/
if
(
!
IsA
(
operand
,
Const
)
)
continue
;
if
(
!
op_in_opfamily
(
clause_op
,
index
->
opfamily
[
0
]))
continue
;
/*
* lefttype is a type of index column, righttype is a
* type of operand (query)
*/
get_op_opfamily_properties
(
clause_op
,
index
->
opfamily
[
0
],
&
strategy_op
,
&
lefttype
,
&
righttype
,
&
recheck
);
/*
* GIN (as GiST) always has lefttype == righttype in pg_amproc
* and they are equal to type Oid on which index was created/designed
*/
extractProcOid
=
get_opfamily_proc
(
index
->
opfamily
[
0
],
lefttype
,
lefttype
,
GIN_EXTRACTQUERY_PROC
);
if
(
!
OidIsValid
(
extractProcOid
)
)
continue
;
/* should not be */
OidFunctionCall3
(
extractProcOid
,
((
Const
*
)
operand
)
->
constvalue
,
PointerGetDatum
(
&
nentries
),
UInt16GetDatum
(
strategy_op
));
if
(
nentries
==
0
)
nfullscan
++
;
else
if
(
nentries
<
0
)
{
/*
* GIN_EXTRACTQUERY_PROC guarantees that nothing will be found
*/
*
indexStartupCost
=
0
;
*
indexTotalCost
=
0
;
*
indexSelectivity
=
0
;
*
indexCorrelation
=
0
;
PG_RETURN_VOID
();
}
}
if
(
nfullscan
==
list_length
(
indexQuals
)
)
{
/*
* All quals are void and require full scan. So
* set max possible cost to prevent index scan.
*/
*
indexStartupCost
=
disable_cost
;
*
indexTotalCost
=
disable_cost
;
*
indexSelectivity
=
1
.
0
;
*
indexCorrelation
=
0
;
PG_RETURN_VOID
();
}
genericcostestimate
(
root
,
index
,
indexQuals
,
outer_rel
,
0
.
0
,
indexStartupCost
,
indexTotalCost
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录