diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-09-19 22:49:53 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-09-19 22:49:53 +0000 |
commit | b74c5436857cfd71a0f94736f19c9b070b053e24 (patch) | |
tree | 366bedff3f9e7c5735cd9b7635b2566ffc90f0a6 /src/backend/utils/adt/selfuncs.c | |
parent | 45e11d098f7b9c611c47e0f8565f4aa88281c914 (diff) | |
download | postgresql-b74c5436857cfd71a0f94736f19c9b070b053e24.tar.gz postgresql-b74c5436857cfd71a0f94736f19c9b070b053e24.zip |
Improve usage of effective_cache_size parameter by assuming that all the
tables in the query compete for cache space, not just the one we are
currently costing an indexscan for. This seems more realistic, and it
definitely will help in examples recently exhibited by Stefan
Kaltenbrunner. To get the total size of all the tables involved, we must
tweak the handling of 'append relations' a bit --- formerly we looked up
information about the child tables on-the-fly during set_append_rel_pathlist,
but it needs to be done before we start doing any cost estimation, so
push it into the add_base_rels_to_query scan.
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index c46dbd6ece2..96d6512ac07 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.211 2006/07/26 17:17:28 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.212 2006/09/19 22:49:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -4647,7 +4647,8 @@ genericcostestimate(PlannerInfo *root, /* use Mackert and Lohman formula to adjust for cache effects */ pages_fetched = index_pages_fetched(pages_fetched, index->pages, - index->rel->pages); + (double) index->pages, + root); /* * Now compute the total disk access cost, and then report a |