Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2300ac0d
Commit
2300ac0d
authored
Feb 07, 1997
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add attribute optimization statistics.
parent
4c0faba0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
580 additions
and
224 deletions
+580
-224
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+524
-197
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+3
-3
src/backend/parser/catalog_utils.c
src/backend/parser/catalog_utils.c
+10
-8
src/backend/parser/parse_query.c
src/backend/parser/parse_query.c
+3
-3
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+5
-4
src/include/commands/vacuum.h
src/include/commands/vacuum.h
+33
-7
src/include/parser/catalog_utils.h
src/include/parser/catalog_utils.h
+2
-2
No files found.
src/backend/commands/vacuum.c
View file @
2300ac0d
This diff is collapsed.
Click to expand it.
src/backend/parser/analyze.c
View file @
2300ac0d
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.2
0 1997/01/22 01:42:54
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.2
1 1997/02/07 16:22:50
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1486,7 +1486,7 @@ any_ordering_op(int restype)
Operator
order_op
;
Oid
order_opid
;
order_op
=
oper
(
"<"
,
restype
,
restype
);
order_op
=
oper
(
"<"
,
restype
,
restype
,
false
);
order_opid
=
oprid
(
order_op
);
return
order_opid
;
...
...
@@ -1554,7 +1554,7 @@ transformSortClause(ParseState *pstate,
sortcl
->
resdom
=
resdom
=
restarget
->
resdom
;
sortcl
->
opoid
=
oprid
(
oper
(
sortby
->
useOp
,
resdom
->
restype
,
resdom
->
restype
));
resdom
->
restype
,
false
));
if
(
sortlist
==
NIL
)
{
s
=
sortlist
=
lcons
(
sortcl
,
NIL
);
}
else
{
...
...
src/backend/parser/catalog_utils.c
View file @
2300ac0d
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.1
5 1997/01/22 01:4
3:08 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.1
6 1997/02/07 16:2
3:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -473,7 +473,7 @@ binary_oper_select_candidate(Oid arg1,
/* Given operator, types of arg1, and arg2, return oper struct */
/* arg1, arg2 --typeids */
Operator
oper
(
char
*
op
,
Oid
arg1
,
Oid
arg2
)
oper
(
char
*
op
,
Oid
arg1
,
Oid
arg2
,
bool
noWarnings
)
{
HeapTuple
tup
;
CandidateList
candidates
;
...
...
@@ -492,7 +492,8 @@ oper(char *op, Oid arg1, Oid arg2)
/*
* no operators of the desired types found
*/
op_error
(
op
,
arg1
,
arg2
);
if
(
!
noWarnings
)
op_error
(
op
,
arg1
,
arg2
);
return
(
NULL
);
}
else
if
(
ncandidates
==
1
)
{
/*
...
...
@@ -523,11 +524,12 @@ oper(char *op, Oid arg1, Oid arg2)
/* we chose none of them */
tp1
=
get_id_type
(
arg1
);
tp2
=
get_id_type
(
arg2
);
elog
(
NOTICE
,
"there is more than one operator %s for types"
,
op
);
elog
(
NOTICE
,
"%s and %s. You will have to retype this query"
,
tname
(
tp1
),
tname
(
tp2
));
elog
(
WARN
,
"using an explicit cast"
);
if
(
!
noWarnings
)
{
elog
(
NOTICE
,
"there is more than one operator %s for types"
,
op
);
elog
(
NOTICE
,
"%s and %s. You will have to retype this query"
,
tname
(
tp1
),
tname
(
tp2
));
elog
(
WARN
,
"using an explicit cast"
);
}
return
(
NULL
);
}
}
...
...
src/backend/parser/parse_query.c
View file @
2300ac0d
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.1
2 1997/01/22 01:43:19
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/parse_query.c,v 1.1
3 1997/02/07 16:23:21
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -352,7 +352,7 @@ make_op(char *opname, Node *ltree, Node *rtree)
/* right operator */
ltypeId
=
(
ltree
==
NULL
)
?
UNKNOWNOID
:
exprType
(
ltree
);
temp
=
right_oper
(
opname
,
ltypeId
);
temp
=
oper
(
opname
,
ltypeId
,
rtypeId
,
false
);
opform
=
(
OperatorTupleForm
)
GETSTRUCT
(
temp
);
left
=
make_operand
(
opname
,
ltree
,
ltypeId
,
opform
->
oprleft
);
right
=
NULL
;
...
...
@@ -411,7 +411,7 @@ make_op(char *opname, Node *ltree, Node *rtree)
((
Const
*
)
ltree
)
->
constbyval
=
tbyval
(
newtype
);
}
temp
=
oper
(
opname
,
ltypeId
,
rtypeId
);
temp
=
oper
(
opname
,
ltypeId
,
rtypeId
,
false
);
opform
=
(
OperatorTupleForm
)
GETSTRUCT
(
temp
);
left
=
make_operand
(
opname
,
ltree
,
ltypeId
,
opform
->
oprleft
);
right
=
make_operand
(
opname
,
rtree
,
rtypeId
,
opform
->
oprright
);
...
...
src/backend/utils/adt/selfuncs.c
View file @
2300ac0d
...
...
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.
4 1996/11/03 06:53:08 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.
5 1997/02/07 16:23:39 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -33,6 +33,7 @@
#include "utils/lsyscache.h"
/* for get_oprrest() */
#include "catalog/pg_statistic.h"
#include "commands/vacuum.h"
/* for ATTNVALS_SCALE */
/* N is not a valid var/constant or relation id */
#define NONVALUE(N) ((N) == -1)
...
...
@@ -68,7 +69,7 @@ eqsel(Oid opid,
if
(
nvals
==
0
)
*
result
=
0
.
0
;
else
*
result
=
1
.
0
/
nvals
;
*
result
=
((
float64data
)
nvals
)
/
((
float64data
)
ATTNVALS_SCALE
)
;
}
return
(
result
);
}
...
...
@@ -125,7 +126,7 @@ intltsel(Oid opid,
if
(
nvals
==
0
)
*
result
=
1
.
0
/
3
.
0
;
else
*
result
=
3
.
0
/
nvals
;
*
result
=
3
.
0
*
((
float64data
)
nvals
)
/
((
float64data
)
ATTNVALS_SCALE
)
;
}
else
{
bottom
=
high
-
low
;
if
(
bottom
==
0
)
...
...
@@ -192,7 +193,7 @@ eqjoinsel(Oid opid,
if
(
max
==
0
)
*
result
=
1
.
0
;
else
*
result
=
1
.
0
/
max
;
*
result
=
((
float64data
)
max
)
/
((
float64data
)
ATTNVALS_SCALE
)
;
}
return
(
result
);
}
...
...
src/include/commands/vacuum.h
View file @
2300ac0d
...
...
@@ -6,13 +6,16 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: vacuum.h,v 1.
5 1997/01/13 03:44:54
momjian Exp $
* $Id: vacuum.h,v 1.
6 1997/02/07 16:23:57
momjian Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef VACUUM_H
#define VACUUM_H
#include <access/funcindex.h>
#include <catalog/pg_index.h>
typedef
struct
VAttListData
{
int
val_dummy
;
struct
VAttListData
*
val_next
;
...
...
@@ -38,23 +41,46 @@ typedef struct VPageListData {
typedef
VPageListData
*
VPageList
;
typedef
struct
{
FuncIndexInfo
finfo
;
FuncIndexInfo
*
finfoP
;
IndexTupleForm
tform
;
int
natts
;
}
IndDesc
;
typedef
struct
{
AttributeTupleForm
attr
;
Datum
best
,
guess1
,
guess2
,
max
,
min
;
int16
best_len
,
guess1_len
,
guess2_len
,
max_len
,
min_len
;
int32
best_cnt
,
guess1_cnt
,
guess1_hits
,
guess2_hits
,
null_cnt
,
nonnull_cnt
;
int32
max_cnt
,
min_cnt
;
regproc
cmpeq
,
cmplt
,
cmpgt
,
outfunc
;
bool
initialized
;
}
VacAttrStats
;
typedef
struct
VRelListData
{
Oid
vrl_relid
;
VAttList
vrl_attlist
;
int
vrl_ntups
;
int
vrl_npages
;
Size
vrl_min_tlen
;
Size
vrl_max_tlen
;
bool
vrl_hasindex
;
struct
VRelListData
*
vrl_next
;
}
VRelListData
;
typedef
VRelListData
*
VRelList
;
typedef
struct
VRelStats
{
Oid
relid
;
int
ntups
;
int
npages
;
Size
min_tlen
;
Size
max_tlen
;
bool
hasindex
;
int
natts
;
VacAttrStats
*
vacattrstats
;
}
VRelStats
;
extern
bool
VacuumRunning
;
extern
void
vc_abort
(
void
);
extern
void
vacuum
(
char
*
vacrel
,
bool
verbose
);
#define ATTNVALS_SCALE 1000000000
/* XXX so it can act as a float4 */
#endif
/* VACUUM_H */
src/include/parser/catalog_utils.h
View file @
2300ac0d
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: catalog_utils.h,v 1.
7 1997/01/22 01:44:0
2 momjian Exp $
* $Id: catalog_utils.h,v 1.
8 1997/02/07 16:24:1
2 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -31,7 +31,7 @@ extern bool tbyval(Type t);
extern
char
*
tname
(
Type
t
);
extern
int
tbyvalue
(
Type
t
);
extern
Oid
oprid
(
Operator
op
);
extern
Operator
oper
(
char
*
op
,
Oid
arg1
,
Oid
arg2
);
extern
Operator
oper
(
char
*
op
,
Oid
arg1
,
Oid
arg2
,
bool
noWarnings
);
extern
Operator
right_oper
(
char
*
op
,
Oid
arg
);
extern
Operator
left_oper
(
char
*
op
,
Oid
arg
);
extern
int
varattno
(
Relation
rd
,
char
*
a
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment