mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Back out cleanup patch. Got old version and needs work.
Neil Conway
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* prepkeyset.c
|
||||
* Special preparation for keyset queries (KSQO).
|
||||
* Special preperation for keyset queries.
|
||||
*
|
||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
@@ -14,6 +14,12 @@
|
||||
#include "postgres.h"
|
||||
#include "optimizer/planmain.h"
|
||||
|
||||
/*
|
||||
* Node_Copy
|
||||
* a macro to simplify calling of copyObject on the specified field
|
||||
*/
|
||||
#define Node_Copy(from, newnode, field) newnode->field = copyObject(from->field)
|
||||
|
||||
bool _use_keyset_query_optimizer = FALSE;
|
||||
|
||||
#ifdef ENABLE_KEY_SET_QUERY
|
||||
@@ -49,20 +55,13 @@ static int TotalExpr;
|
||||
* a HAVING, or a GROUP BY. It must be a single table and have KSQO
|
||||
* set to 'on'.
|
||||
*
|
||||
* The primary use of this transformation is to avoid the exponential
|
||||
* The primary use of this transformation is to avoid the exponrntial
|
||||
* memory consumption of cnfify() and to make use of index access
|
||||
* methods.
|
||||
*
|
||||
* daveh@insightdist.com 1998-08-31
|
||||
*
|
||||
* May want to also prune out duplicate terms.
|
||||
*
|
||||
* XXX: this code is currently not compiled because it has not been
|
||||
* updated to work with the re-implementation of UNION/INTERSECT/EXCEPT
|
||||
* in PostgreSQL 7.1. However, it is of questionable value in any
|
||||
* case, because it changes the semantics of the original query:
|
||||
* UNION will add an implicit SELECT DISTINCT, which might change
|
||||
* the results that are returned.
|
||||
**********************************************************************/
|
||||
void
|
||||
transformKeySetQuery(Query *origNode)
|
||||
|
||||
Reference in New Issue
Block a user