diff options
| author | Bruce Momjian <bruce@momjian.us> | 2002-06-25 17:58:10 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2002-06-25 17:58:10 +0000 |
| commit | e2c007046f947a920958e4c0789d1ee47c5c80a6 (patch) | |
| tree | 4b95180e570881e602eebe97428786615e8cd0e4 /src/backend/optimizer/path/costsize.c | |
| parent | ed275aea4270adf9c3ebeeb65a9a9af7b157e3ca (diff) | |
| download | postgresql-e2c007046f947a920958e4c0789d1ee47c5c80a6.tar.gz | |
Back out cleanup patch. Got old version and needs work.
Neil Conway
Diffstat (limited to 'src/backend/optimizer/path/costsize.c')
| -rw-r--r-- | src/backend/optimizer/path/costsize.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index b626567b21..ecf22eb118 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -42,7 +42,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.86 2002/06/25 17:27:20 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/costsize.c,v 1.87 2002/06/25 17:58:10 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -154,11 +154,11 @@ cost_seqscan(Path *path, Query *root, * * Given a guesstimated cache size, we estimate the actual I/O cost per page * with the entirely ad-hoc equations: - * if relpages >= effective_cache_size: - * random_page_cost * (1 - (effective_cache_size/relpages)/2) - * if relpages < effective_cache_size: - * 1 + (random_page_cost/2-1) * (relpages/effective_cache_size) ** 2 - * These give the right asymptotic behavior (=> 1.0 as relpages becomes + * for rel_size <= effective_cache_size: + * 1 + (random_page_cost/2-1) * (rel_size/effective_cache_size) ** 2 + * for rel_size >= effective_cache_size: + * random_page_cost * (1 - (effective_cache_size/rel_size)/2) + * These give the right asymptotic behavior (=> 1.0 as rel_size becomes * small, => random_page_cost as it becomes large) and meet in the middle * with the estimate that the cache is about 50% effective for a relation * of the same size as effective_cache_size. (XXX this is probably all |
