Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
68be513f
Commit
68be513f
authored
25 years ago
by
Tom Lane
Browse files
Options
Downloads
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
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/utils/cache/lsyscache.c
+15
-3
15 additions, 3 deletions
src/backend/utils/cache/lsyscache.c
with
15 additions
and
3 deletions
src/backend/utils/cache/lsyscache.c
+
15
−
3
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/0
1/26 05:57:17 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.
40
2000/0
2/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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment