Re: [PATCHES] Display Pg buffer cache (WIP)

2005-03-05 Thread Mark Kirkwood
Neil Conway wrote: If you do decide to hold the BufMappingLock, it might make sense to: 1. allocate an array of NBuffers elements 2. acquire BufferMappingLock in share mode 3. sequentially scan through the buffer pool, copying data into the array 4. release the lock 5. on each subsequent call to

[PATCHES] fork() refactoring

2005-03-05 Thread Neil Conway
This patch moves all the common code that is usually invoked before doing a fork() into a single function, fork_process(). It is not aware of the EXEC_BACKEND machinery, so it should be used as fork() currently is -- inside an #ifndef EXEC_BACKEND block, if appropriate. I wasn't sure whether

Re: [PATCHES] fork() refactoring

2005-03-05 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: This patch moves all the common code that is usually invoked before doing a fork() into a single function, fork_process(). It is not aware of the EXEC_BACKEND machinery, so it should be used as fork() currently is -- inside an #ifndef EXEC_BACKEND

Re: [PATCHES] Display Pg buffer cache (WIP)

2005-03-05 Thread Tom Lane
Mark Kirkwood [EMAIL PROTECTED] writes: In addition to holding the BufMappingLock, each buffer header is (spin) locked before examining it, hopefully this is correct - BTW, I like the new buffer lock design. It'd be possible to dispense with the per-buffer spinlocks so long as you look only at

[PATCHES] Harmless space allocation typo

2005-03-05 Thread Heikki Linnakangas
Here's a tiny fix for a harmless typo in catalog.c: Too much space is allocated for tablespace file path, I guess the directory name used to be pg_tablespaces instead of pg_tblspc at some point. - HeikkiIndex: catalog.c === RCS

[PATCHES] Cleaning up unreferenced table files

2005-03-05 Thread Heikki Linnakangas
Here's a patch for the TODO item Remove unreferenced table files created by transactions that were in-progress when the server terminated abruptly. It adds a new function, CleanupStaleRelFiles, that scans through the data directory and removes all table files that are not mentioned in pg_class

Re: [PATCHES] Cleaning up unreferenced table files

2005-03-05 Thread Tom Lane
Heikki Linnakangas [EMAIL PROTECTED] writes: Here's a patch for the TODO item Remove unreferenced table files created by transactions that were in-progress when the server terminated abruptly. xlog.c is a fairly random place to put that functionality. Didn't it strike any warning bells for

Re: [PATCHES] Cleaning up unreferenced table files

2005-03-05 Thread Heikki Linnakangas
On Sat, 5 Mar 2005, Tom Lane wrote: Heikki Linnakangas [EMAIL PROTECTED] writes: Here's a patch for the TODO item Remove unreferenced table files created by transactions that were in-progress when the server terminated abruptly. xlog.c is a fairly random place to put that functionality. Didn't