Index: doc/src/sgml/perform.sgml =================================================================== RCS file: /home/alvherre/cvs/pgsql-server/doc/src/sgml/perform.sgml,v retrieving revision 1.45 diff -c -r1.45 perform.sgml *** doc/src/sgml/perform.sgml 22 Apr 2004 17:38:14 -0000 1.45 --- doc/src/sgml/perform.sgml 4 May 2004 00:44:07 -0000 *************** *** 5,10 **** --- 5,14 ---- Performance Tips + + performance + + Query performance can be affected by many things. Some of these can be manipulated by the user, while others are fundamental to the underlying Index: src/backend/access/transam/xact.c =================================================================== RCS file: /home/alvherre/cvs/pgsql-server/src/backend/access/transam/xact.c,v retrieving revision 1.165 diff -c -r1.165 xact.c *** src/backend/access/transam/xact.c 5 Apr 2004 03:11:39 -0000 1.165 --- src/backend/access/transam/xact.c 4 May 2004 01:31:37 -0000 *************** *** 475,483 **** TransactionId xid = GetCurrentTransactionId(); XLogRecPtr recptr; - /* Tell bufmgr and smgr to prepare for commit */ - BufmgrCommit(); - START_CRIT_SECTION(); /* --- 475,480 ---- *************** *** 964,970 **** smgrDoPendingDeletes(true); AtCommit_Cache(); AtEOXact_Buffers(true); - /* smgrcommit already done */ AtCommit_Locks(); --- 961,966 ---- *************** *** 1074,1080 **** smgrDoPendingDeletes(false); AtAbort_Cache(); AtEOXact_Buffers(false); - smgrabort(); AtAbort_Locks(); --- 1070,1075 ---- Index: src/backend/storage/buffer/bufmgr.c =================================================================== RCS file: /home/alvherre/cvs/pgsql-server/src/backend/storage/buffer/bufmgr.c,v retrieving revision 1.164 diff -c -r1.164 bufmgr.c *** src/backend/storage/buffer/bufmgr.c 25 Apr 2004 23:50:54 -0000 1.164 --- src/backend/storage/buffer/bufmgr.c 4 May 2004 00:45:19 -0000 *************** *** 940,956 **** } /* - * Do whatever is needed to prepare for commit at the bufmgr and smgr levels - */ - void - BufmgrCommit(void) - { - /* Nothing to do in bufmgr anymore... */ - - smgrcommit(); - } - - /* * BufferGetBlockNumber * Returns the block number associated with a buffer. * --- 940,945 ---- Index: src/backend/storage/smgr/md.c =================================================================== RCS file: /home/alvherre/cvs/pgsql-server/src/backend/storage/smgr/md.c,v retrieving revision 1.104 diff -c -r1.104 md.c *** src/backend/storage/smgr/md.c 19 Apr 2004 17:42:58 -0000 1.104 --- src/backend/storage/smgr/md.c 4 May 2004 00:46:51 -0000 *************** *** 576,605 **** } /* - * mdcommit() -- Commit a transaction. - */ - bool - mdcommit(void) - { - /* - * We don't actually have to do anything here... - */ - return true; - } - - /* - * mdabort() -- Abort a transaction. - */ - bool - mdabort(void) - { - /* - * We don't actually have to do anything here... - */ - return true; - } - - /* * mdsync() -- Sync previous writes to stable storage. */ bool --- 576,581 ---- Index: src/backend/storage/smgr/smgr.c =================================================================== RCS file: /home/alvherre/cvs/pgsql-server/src/backend/storage/smgr/smgr.c,v retrieving revision 1.70 diff -c -r1.70 smgr.c *** src/backend/storage/smgr/smgr.c 11 Feb 2004 22:55:25 -0000 1.70 --- src/backend/storage/smgr/smgr.c 4 May 2004 01:10:48 -0000 *************** *** 47,54 **** char *buffer); BlockNumber (*smgr_nblocks) (SMgrRelation reln); BlockNumber (*smgr_truncate) (SMgrRelation reln, BlockNumber nblocks); - bool (*smgr_commit) (void); /* may be NULL */ - bool (*smgr_abort) (void); /* may be NULL */ bool (*smgr_sync) (void); /* may be NULL */ } f_smgr; --- 47,52 ---- *************** *** 56,62 **** static const f_smgr smgrsw[] = { /* magnetic disk */ {mdinit, NULL, mdclose, mdcreate, mdunlink, mdextend, ! mdread, mdwrite, mdnblocks, mdtruncate, mdcommit, mdabort, mdsync } }; --- 54,60 ---- static const f_smgr smgrsw[] = { /* magnetic disk */ {mdinit, NULL, mdclose, mdcreate, mdunlink, mdextend, ! mdread, mdwrite, mdnblocks, mdtruncate, mdsync } }; *************** *** 623,671 **** } /* - * smgrcommit() -- Prepare to commit changes made during the current - * transaction. - * - * This is called before we actually commit. - */ - void - smgrcommit(void) - { - int i; - - for (i = 0; i < NSmgr; i++) - { - if (smgrsw[i].smgr_commit) - { - if (! (*(smgrsw[i].smgr_commit)) ()) - elog(FATAL, "transaction commit failed on %s: %m", - DatumGetCString(DirectFunctionCall1(smgrout, - Int16GetDatum(i)))); - } - } - } - - /* - * smgrabort() -- Abort changes made during the current transaction. - */ - void - smgrabort(void) - { - int i; - - for (i = 0; i < NSmgr; i++) - { - if (smgrsw[i].smgr_abort) - { - if (! (*(smgrsw[i].smgr_abort)) ()) - elog(FATAL, "transaction abort failed on %s: %m", - DatumGetCString(DirectFunctionCall1(smgrout, - Int16GetDatum(i)))); - } - } - } - - /* * smgrsync() -- Sync files to disk at checkpoint time. */ void --- 621,626 ---- Index: src/include/storage/smgr.h =================================================================== RCS file: /home/alvherre/cvs/pgsql-server/src/include/storage/smgr.h,v retrieving revision 1.41 diff -c -r1.41 smgr.h *** src/include/storage/smgr.h 11 Feb 2004 22:55:26 -0000 1.41 --- src/include/storage/smgr.h 4 May 2004 00:46:37 -0000 *************** *** 62,69 **** extern BlockNumber smgrtruncate(SMgrRelation reln, BlockNumber nblocks); extern void smgrDoPendingDeletes(bool isCommit); extern int smgrGetPendingDeletes(bool forCommit, RelFileNode **ptr); - extern void smgrcommit(void); - extern void smgrabort(void); extern void smgrsync(void); extern void smgr_redo(XLogRecPtr lsn, XLogRecord *record); --- 62,67 ---- *************** *** 83,90 **** extern bool mdwrite(SMgrRelation reln, BlockNumber blocknum, char *buffer); extern BlockNumber mdnblocks(SMgrRelation reln); extern BlockNumber mdtruncate(SMgrRelation reln, BlockNumber nblocks); - extern bool mdcommit(void); - extern bool mdabort(void); extern bool mdsync(void); /* smgrtype.c */ --- 81,86 ----