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
1c1ecd51
Commit
1c1ecd51
authored
Jun 28, 2006
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve planner estimates for size of tuple hash tables.
parent
485375a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/planner.c
+2
-2
src/backend/optimizer/plan/subselect.c
src/backend/optimizer/plan/subselect.c
+6
-4
No files found.
src/backend/optimizer/plan/planner.c
View file @
1c1ecd51
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.
199 2006/03/05 15:58:29 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.
200 2006/06/28 20:04:38 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1298,7 +1298,7 @@ choose_hashed_grouping(PlannerInfo *root, double tuple_fraction,
...
@@ -1298,7 +1298,7 @@ choose_hashed_grouping(PlannerInfo *root, double tuple_fraction,
}
}
/* Estimate per-hash-entry space at tuple width... */
/* Estimate per-hash-entry space at tuple width... */
hashentrysize
=
cheapest_path_width
;
hashentrysize
=
MAXALIGN
(
cheapest_path_width
)
+
MAXALIGN
(
sizeof
(
MinimalTupleData
))
;
/* plus space for pass-by-ref transition values... */
/* plus space for pass-by-ref transition values... */
hashentrysize
+=
agg_counts
->
transitionSpace
;
hashentrysize
+=
agg_counts
->
transitionSpace
;
/* plus the per-hash-entry overhead */
/* plus the per-hash-entry overhead */
...
...
src/backend/optimizer/plan/subselect.c
View file @
1c1ecd51
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.10
7 2006/05/03 00:24:56
tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/subselect.c,v 1.10
8 2006/06/28 20:04:38
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -585,11 +585,13 @@ subplan_is_hashable(SubLink *slink, SubPlan *node)
...
@@ -585,11 +585,13 @@ subplan_is_hashable(SubLink *slink, SubPlan *node)
return
false
;
return
false
;
/*
/*
* The estimated size of the subquery result must fit in work_mem. (XXX
* The estimated size of the subquery result must fit in work_mem.
* what about hashtable overhead?)
* (Note: we use sizeof(HeapTupleHeaderData) here even though the tuples
* will actually be stored as MinimalTuples; this provides some fudge
* factor for hashtable overhead.)
*/
*/
subquery_size
=
node
->
plan
->
plan_rows
*
subquery_size
=
node
->
plan
->
plan_rows
*
(
MAXALIGN
(
node
->
plan
->
plan_width
)
+
MAXALIGN
(
sizeof
(
HeapTupleData
)));
(
MAXALIGN
(
node
->
plan
->
plan_width
)
+
MAXALIGN
(
sizeof
(
HeapTuple
Header
Data
)));
if
(
subquery_size
>
work_mem
*
1024L
)
if
(
subquery_size
>
work_mem
*
1024L
)
return
false
;
return
false
;
...
...
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