]> granicus.if.org Git - postgresql/commitdiff
Fix for vacuum and cache use. Fix for BSDI 4.0.
authorBruce Momjian <bruce@momjian.us>
Mon, 12 Oct 1998 00:53:42 +0000 (00:53 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 12 Oct 1998 00:53:42 +0000 (00:53 +0000)
src/backend/access/heap/heapam.c
src/backend/commands/vacuum.c
src/backend/utils/cache/catcache.c
src/backend/utils/cache/inval.c
src/include/utils/inval.h
src/makefiles/Makefile.bsdi
src/makefiles/Makefile.linux
src/makefiles/Makefile.sco

index b0500c9b6ab4d33d2d1936b593d012475bbc85bd..c2b346e2f5abf15489f0355670526fa43a2083b0 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.36 1998/10/08 18:29:12 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.37 1998/10/12 00:53:30 momjian Exp $
  *
  *
  * INTERFACE ROUTINES
@@ -98,8 +98,6 @@
 
 static void doinsert(Relation relation, HeapTuple tup);
 
-static bool ImmediateInvalidation;
-
 /* ----------------------------------------------------------------
  *                                              heap support routines
  * ----------------------------------------------------------------
@@ -484,22 +482,6 @@ doinsert(Relation relation, HeapTuple tup)
        return;
 }
 
-/*
- *             HeapScanIsValid is now a macro in relscan.h -cim 4/27/91
- */
-
-#ifdef NOT_USED
-/* ----------------
- *             SetHeapAccessMethodImmediateInvalidation
- * ----------------
- */
-void
-SetHeapAccessMethodImmediateInvalidation(bool on)
-{
-       ImmediateInvalidation = on;
-}
-
-#endif
 
 /* ----------------------------------------------------------------
  *                                      heap access method interface
@@ -1149,9 +1131,7 @@ heap_insert(Relation relation, HeapTuple tup)
                 *              invalidate caches (only works for system relations)
                 * ----------------
                 */
-               SetRefreshWhenInvalidate(ImmediateInvalidation);
                RelationInvalidateHeapTuple(relation, tup);
-               SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
        }
 
        return tup->t_oid;
@@ -1253,9 +1233,7 @@ heap_delete(Relation relation, ItemPointer tid)
         *      invalidate caches
         * ----------------
         */
-       SetRefreshWhenInvalidate(ImmediateInvalidation);
        RelationInvalidateHeapTuple(relation, tp);
-       SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
 
        WriteBuffer(buf);
        if (IsSystemRelationName(RelationGetRelationName(relation)->data))
@@ -1407,9 +1385,7 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple replace_tuple)
         *      invalidate caches
         * ----------------
         */
-       SetRefreshWhenInvalidate(ImmediateInvalidation);
        RelationInvalidateHeapTuple(relation, old_tuple);
-       SetRefreshWhenInvalidate((bool) !ImmediateInvalidation);
 
        WriteBuffer(buffer);
 
index 35f34f30a208bd0458accc8f7e656ed8ebecbf8a..c0a8789aa9ca8ea6dca8acd71cfefa09824b3061 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.87 1998/10/09 21:31:34 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.88 1998/10/12 00:53:31 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1084,6 +1084,8 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
                        newtup = (HeapTuple) palloc(tuple_len);
                        memmove((char *) newtup, (char *) tuple, tuple_len);
 
+                       RelationInvalidateHeapTuple(onerel, tuple);
+
                        /* store transaction information */
                        TransactionIdStore(myXID, &(newtup->t_xmin));
                        newtup->t_cmin = myCID;
@@ -1876,12 +1878,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex, VRelStats *
        /* XXX -- after write, should invalidate relcache in other backends */
        WriteNoReleaseBuffer(ItemPointerGetBlockNumber(&rtup->t_ctid));
 
-       /*
-        * invalidating system relations confuses the function cache of
-        * pg_operator and pg_opclass, bjm
-        */
-       if (!IsSystemRelationName(pgcform->relname.data))
-               RelationInvalidateHeapTuple(rd, rtup);
+       RelationInvalidateHeapTuple(rd, rtup);
 
        ReleaseBuffer(buffer);
        heap_close(rd);
index d54d2584ae861bf11bbd99096e9057122cf96b3e..97accc93db04345dd9a9f396f672aa28fb87d5e1 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.34 1998/09/01 04:32:57 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.35 1998/10/12 00:53:33 momjian Exp $
  *
  * Notes:
  *             XXX This needs to use exception.h to handle recovery when
@@ -1108,6 +1108,7 @@ RelationInvalidateCatalogCacheTuple(Relation relation,
         */
        Assert(RelationIsValid(relation));
        Assert(HeapTupleIsValid(tuple));
+       Assert(PointerIsValid(function));
        CACHE1_elog(DEBUG, "RelationInvalidateCatalogCacheTuple: called");
 
        /* ----------------
@@ -1132,9 +1133,11 @@ RelationInvalidateCatalogCacheTuple(Relation relation,
                if (relationId != ccp->relationId)
                        continue;
 
+#ifdef NOT_USED
                /* OPT inline simplification of CatalogCacheIdInvalidate */
                if (!PointerIsValid(function))
                        function = CatalogCacheIdInvalidate;
+#endif
 
                (*function) (ccp->id,
                                 CatalogCacheComputeTupleHashIndex(ccp, relation, tuple),
index d21540776defba24850ceaad06e17bec03c54e05..0517e1a0cda1ef029a780120afd3f064b6a4e3c0 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.16 1998/09/01 04:33:00 momjian Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/cache/inval.c,v 1.17 1998/10/12 00:53:34 momjian Exp $
  *
  * Note - this code is real crufty...
  *
@@ -74,7 +74,6 @@ typedef InvalidationMessageData *InvalidationMessage;
  * ----------------
  */
 static LocalInvalid Invalid = EmptyLocalInvalid;               /* XXX global */
-static bool RefreshWhenInvalidate = false;
 
 Oid                    MyRelationRelationId = InvalidOid;
 Oid                    MyAttributeRelationId = InvalidOid;
@@ -572,20 +571,6 @@ RegisterInvalid(bool send)
        Invalid = EmptyLocalInvalid;
 }
 
-/*
- * SetRefreshWhenInvalidate --
- *             Causes the local caches to be immediately refreshed iff true.
- */
-void
-SetRefreshWhenInvalidate(bool on)
-{
-#ifdef INVALIDDEBUG
-       elog(DEBUG, "RefreshWhenInvalidate(%d) called", on);
-#endif  /* defined(INVALIDDEBUG) */
-
-       RefreshWhenInvalidate = on;
-}
-
 /*
  * RelationIdInvalidateHeapTuple --
  *             Causes the given tuple in a relation to be invalidated.
@@ -641,9 +626,11 @@ RelationInvalidateHeapTuple(Relation relation, HeapTuple tuple)
                                                                        tuple,
                                                                        RelationIdRegisterLocalInvalid);
 
+#ifdef NOT_USED
        if (RefreshWhenInvalidate)
                /* what does this do?  bjm 1998/08/20 */
                RelationInvalidateCatalogCacheTuple(relation,
                                                                                        tuple,
                                                                                        (void (*) ()) NULL);
+#endif
 }
index bb2591552b3ee1feb7cf0d0dd0e81ca2ff993f8e..f035c293032dc6891ae38e5f3435550d0f2fc987 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: inval.h,v 1.9 1998/09/01 04:39:15 momjian Exp $
+ * $Id: inval.h,v 1.10 1998/10/12 00:53:36 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -22,8 +22,6 @@ extern void DiscardInvalid(void);
 
 extern void RegisterInvalid(bool send);
 
-extern void SetRefreshWhenInvalidate(bool on);
-
 extern void RelationInvalidateHeapTuple(Relation relation, HeapTuple tuple);
 
 /*
index 88fe307e1569a257de2bedafa1b3dc1abfc14054..b1da0004cb755c134e4029e0e7dd01290a8d1ec9 100644 (file)
@@ -1,4 +1,9 @@
 # for bsdi 4.0 ELF
 # if we defined .so in template/bsdi_4.0
+
+ifeq ($(DLSUFFIX), .so)
+LDFLAGS+= -export-dynamic
+endif
+
 %.so: %.o
        $(LD) -shared -o $@ $<
index 0166e3d16774b12a9192b926c5d2f7184e3cff36..91e50d672dbfbf1036411fdbf27d4fcf3630bab3 100644 (file)
@@ -1,4 +1,4 @@
-LDFLAGS+= -export-dynamic #-Wl,-rpath -Wl,$(LIBDIR)
+LDFLAGS+= -export-dynamic
 MK_NO_LORDER= true
 
 %.so: %.o
index 2bc7627eb80e9b39ef899a40fe9b4f077ba68272..325c9516bdfb126fc4c844fd6bb715c2876031b5 100644 (file)
@@ -1,6 +1,5 @@
 CFLAGS += -dy
 LDFLAGS += -W l,-Bexport
-%.so: %.o
-       $(LD) -G -Bdynamic -o $@ $<
+
 %.so: %.o
        $(LD) -G -Bdynamic -o $@ $<