mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Major patch to speed up backend startup after profiling analysis.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.7 1997/07/24 20:16:17 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.8 1997/08/24 23:07:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -96,6 +96,10 @@ char *oidout(Oid o)
|
||||
* PUBLIC ROUTINES *
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* If you change this function, change heap_keytest()
|
||||
* because we have hardcoded this in there as an optimization
|
||||
*/
|
||||
bool oideq(Oid arg1, Oid arg2)
|
||||
{
|
||||
return(arg1 == arg2);
|
||||
|
||||
17
src/backend/utils/cache/catcache.c
vendored
17
src/backend/utils/cache/catcache.c
vendored
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.7 1997/08/19 21:34:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.8 1997/08/24 23:07:42 momjian Exp $
|
||||
*
|
||||
* Notes:
|
||||
* XXX This needs to use exception.h to handle recovery when
|
||||
@@ -656,8 +656,19 @@ InitSysCache(char *relname,
|
||||
* and the LRU tuple list
|
||||
* ----------------
|
||||
*/
|
||||
for (i = 0; i <= NCCBUCK; ++i) {
|
||||
cp->cc_cache[i] = DLNewList();
|
||||
{
|
||||
/*
|
||||
* We can only do this optimization because the number of hash
|
||||
* buckets never changes. Without it, we call malloc() too much.
|
||||
* We could move this to dllist.c, but the way we do this is not
|
||||
* dynamic/portabl, so why allow other routines to use it.
|
||||
*/
|
||||
void *cache_begin = malloc((NCCBUCK+1)*sizeof(Dllist));
|
||||
for (i = 0; i <= NCCBUCK; ++i) {
|
||||
cp->cc_cache[i] = cache_begin + i * sizeof(Dllist);
|
||||
cp->cc_cache[i]->dll_head = 0;
|
||||
cp->cc_cache[i]->dll_tail = 0;
|
||||
}
|
||||
}
|
||||
|
||||
cp->cc_lrulist = DLNewList();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.2 1997/08/19 21:35:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.3 1997/08/24 23:07:50 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX This is a preliminary implementation which lacks fail-fast
|
||||
@@ -20,7 +20,6 @@
|
||||
#include "utils/memutils.h" /* where declarations of this file goes */
|
||||
|
||||
static Pointer OrderedElemGetBase(OrderedElem elem);
|
||||
static void OrderedElemInit(OrderedElem elem, OrderedSet set);
|
||||
static void OrderedElemPush(OrderedElem elem);
|
||||
static void OrderedElemPushHead(OrderedElem elem);
|
||||
|
||||
@@ -49,18 +48,6 @@ OrderedSetInit(OrderedSet set, Offset offset)
|
||||
set->offset = offset;
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedElemInit --
|
||||
*/
|
||||
static void
|
||||
OrderedElemInit(OrderedElem elem, OrderedSet set)
|
||||
{
|
||||
elem->set = set;
|
||||
/* mark as unattached */
|
||||
elem->next = NULL;
|
||||
elem->prev = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedSetContains --
|
||||
* True iff ordered set contains given element.
|
||||
@@ -148,7 +135,10 @@ OrderedElemPop(OrderedElem elem)
|
||||
void
|
||||
OrderedElemPushInto(OrderedElem elem, OrderedSet set)
|
||||
{
|
||||
OrderedElemInit(elem, set);
|
||||
elem->set = set;
|
||||
/* mark as unattached */
|
||||
elem->next = NULL;
|
||||
elem->prev = NULL;
|
||||
OrderedElemPush(elem);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user