Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita3c1a11

Browse files
committed
If we're going to expose VariableStatData for contrib modules to use,
then we should export a reasonable set of the supporting routines too.
1 parentf1b3d5b commita3c1a11

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

‎src/backend/utils/adt/selfuncs.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.201 2006/04/26 22:32:56 momjian Exp $
18+
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.202 2006/04/27 00:46:58 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -111,8 +111,6 @@
111111
#include"utils/syscache.h"
112112

113113

114-
staticdoublemcv_selectivity(VariableStatData*vardata,FmgrInfo*opproc,
115-
Datumconstval,double*sumcommonp);
116114
staticdoubleineq_histogram_selectivity(VariableStatData*vardata,
117115
FmgrInfo*opproc,boolisgt,
118116
Datumconstval,Oidconsttype);
@@ -138,12 +136,6 @@ static double convert_one_bytea_to_scalar(unsigned char *value, int valuelen,
138136
intrangelo,intrangehi);
139137
staticchar*convert_string_datum(Datumvalue,Oidtypid);
140138
staticdoubleconvert_timevalue_to_scalar(Datumvalue,Oidtypid);
141-
staticvoidget_join_variables(PlannerInfo*root,List*args,
142-
VariableStatData*vardata1,
143-
VariableStatData*vardata2);
144-
staticvoidexamine_variable(PlannerInfo*root,Node*node,intvarRelid,
145-
VariableStatData*vardata);
146-
staticdoubleget_variable_numdistinct(VariableStatData*vardata);
147139
staticboolget_variable_maximum(PlannerInfo*root,VariableStatData*vardata,
148140
Oidsortop,Datum*max);
149141
staticSelectivityprefix_selectivity(VariableStatData*vardata,
@@ -476,7 +468,7 @@ scalarineqsel(PlannerInfo *root, Oid operator, bool isgt,
476468
* total population is returned into *sumcommonp. Zeroes are returned
477469
* if there is no MCV list.
478470
*/
479-
staticdouble
471+
double
480472
mcv_selectivity(VariableStatData*vardata,FmgrInfo*opproc,Datumconstval,
481473
double*sumcommonp)
482474
{
@@ -3203,7 +3195,7 @@ get_restriction_variable(PlannerInfo *root, List *args, int varRelid,
32033195
* get_join_variables
32043196
*Apply examine_variable() to each side of a join clause.
32053197
*/
3206-
staticvoid
3198+
void
32073199
get_join_variables(PlannerInfo*root,List*args,
32083200
VariableStatData*vardata1,VariableStatData*vardata2)
32093201
{
@@ -3246,7 +3238,7 @@ get_join_variables(PlannerInfo *root, List *args,
32463238
*
32473239
* Caller is responsible for doing ReleaseVariableStats() before exiting.
32483240
*/
3249-
staticvoid
3241+
void
32503242
examine_variable(PlannerInfo*root,Node*node,intvarRelid,
32513243
VariableStatData*vardata)
32523244
{
@@ -3429,7 +3421,7 @@ examine_variable(PlannerInfo *root, Node *node, int varRelid,
34293421
* NB: be careful to produce an integral result, since callers may compare
34303422
* the result to exact integer counts.
34313423
*/
3432-
staticdouble
3424+
double
34333425
get_variable_numdistinct(VariableStatData*vardata)
34343426
{
34353427
doublestadistinct;

‎src/include/utils/selfuncs.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/utils/selfuncs.h,v 1.30 2006/04/26 22:33:36 momjian Exp $
11+
* $PostgreSQL: pgsql/src/include/utils/selfuncs.h,v 1.31 2006/04/27 00:46:59 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -97,6 +97,19 @@ typedef enum
9797

9898
/* selfuncs.c */
9999

100+
externvoidexamine_variable(PlannerInfo*root,Node*node,intvarRelid,
101+
VariableStatData*vardata);
102+
externboolget_restriction_variable(PlannerInfo*root,List*args,
103+
intvarRelid,
104+
VariableStatData*vardata,Node**other,
105+
bool*varonleft);
106+
externvoidget_join_variables(PlannerInfo*root,List*args,
107+
VariableStatData*vardata1,
108+
VariableStatData*vardata2);
109+
externdoubleget_variable_numdistinct(VariableStatData*vardata);
110+
externdoublemcv_selectivity(VariableStatData*vardata,FmgrInfo*opproc,
111+
Datumconstval,double*sumcommonp);
112+
100113
externPattern_Prefix_Statuspattern_fixed_prefix(Const*patt,
101114
Pattern_Typeptype,
102115
Const**prefix,
@@ -154,8 +167,5 @@ extern Selectivity estimate_hash_bucketsize(PlannerInfo *root, Node *hashkey,
154167
externDatumbtcostestimate(PG_FUNCTION_ARGS);
155168
externDatumhashcostestimate(PG_FUNCTION_ARGS);
156169
externDatumgistcostestimate(PG_FUNCTION_ARGS);
157-
externboolget_restriction_variable(PlannerInfo*root,List*args,intvarRelid,
158-
VariableStatData*vardata,Node**other,
159-
bool*varonleft);
160170

161171
#endif/* SELFUNCS_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp