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
68be513f
Commit
68be513f
authored
Feb 16, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If we don't have any stats for a boolean column, assume
the disbursion is 0.5, not something small.
parent
deee4e16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/lsyscache.c
+15
-3
No files found.
src/backend/utils/cache/lsyscache.c
View file @
68be513f
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.
39 2000/01/26 05:57:17 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.
40 2000/02/16 01:00:23 tgl
Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
...
...
@@ -183,6 +183,7 @@ double
get_attdisbursion
(
Oid
relid
,
AttrNumber
attnum
,
double
min_estimate
)
{
HeapTuple
atp
;
Form_pg_attribute
att_tup
;
double
disbursion
;
int32
ntuples
;
...
...
@@ -197,10 +198,21 @@ get_attdisbursion(Oid relid, AttrNumber attnum, double min_estimate)
relid
,
attnum
);
return
min_estimate
;
}
att_tup
=
(
Form_pg_attribute
)
GETSTRUCT
(
atp
);
disbursion
=
((
Form_pg_attribute
)
GETSTRUCT
(
atp
))
->
attdisbursion
;
disbursion
=
att_tup
->
attdisbursion
;
if
(
disbursion
>
0
.
0
)
return
disbursion
;
/* we have a specific estimate */
return
disbursion
;
/* we have a specific estimate from VACUUM */
/*
* Special-case boolean columns: the disbursion of a boolean is highly
* unlikely to be anywhere near 1/numtuples, instead it's probably more
* like 0.5.
*
* Are there any other cases we should wire in special estimates for?
*/
if
(
att_tup
->
atttypid
==
BOOLOID
)
return
0
.
5
;
/*
* Disbursion is either 0 (no data available) or -1 (disbursion
...
...
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