projects
/
users
/
hanada
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0c27c05
)
Use reltuples/relpages in pg_class to estimate costs for foreign tables.
author
Shigeru Hanada
<
[email protected]
>
Tue, 5 Oct 2010 11:18:16 +0000
(20:18 +0900)
committer
Shigeru Hanada
<
[email protected]
>
Tue, 5 Oct 2010 11:18:16 +0000
(20:18 +0900)
src/backend/optimizer/util/plancat.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/optimizer/util/plancat.c
b/src/backend/optimizer/util/plancat.c
index e83e50f65be31a26985270b2a9f81af01f00a3f5..14b4019f60ef823389e84040ffefbdd5cfc667dd 100644
(file)
--- a/
src/backend/optimizer/util/plancat.c
+++ b/
src/backend/optimizer/util/plancat.c
@@
-440,6
+440,11
@@
estimate_rel_size(Relation rel, int32 *attr_widths,
*pages = 1;
*tuples = 1;
break;
+ case RELKIND_FOREIGN_TABLE:
+ /* foreign tables has no storage, trust statistics */
+ *pages = rel->rd_rel->relpages;
+ *tuples = rel->rd_rel->reltuples;
+ break;
default:
/* else it has no disk storage; probably shouldn't get here? */
*pages = 0;