[HACKERS] Can postgres create a file with physically continuous blocks.

2010-12-18 Thread flyusa2010 fly
folks, Does postgres make an effort to create a file with physically continuous blocks? Thanks!

[HACKERS] can shared cache be swapped to disk?

2010-12-18 Thread flyusa2010 fly
hi, folks! I see that shared cache is implemented by system v shared memory. I wonder whether data in this area can be swapped out to disk. Isn't it bad that we read data from disk, put data in shared cache, and finally data in shared cache is swapped to disk again! Why not use shmctl(..SHM_LOCK.

[HACKERS] random write in xlog?

2010-12-07 Thread flyusa2010 fly
Hi, folks, I trace the running postgres, and I found that there are some randoms writes in xlog files! To my impression, log file writing is always sequential, how come random writes happen? Thanks in advance!

[HACKERS] the number of file descriptors when using POSIX semaphore

2010-12-06 Thread flyusa2010 fly
Hi, folks, in src/template/darwin: # Select appropriate semaphore support. Darwin 6.0 (Mac OS X 10.2) and up # support System V semaphores; before that we have to use POSIX semaphores, # which are less good for our purposes because they eat a file descriptor # per backend per max_connection slot.

[HACKERS] Using different semaphore for locking

2010-12-05 Thread flyusa2010 fly
I found that postgres uses different semaphore system call on some different operating systems. For example, I found that on linux, System V semaphore (semop etc.) is used to implement locking, while on Darwin, POSIX semaphore (sem_wait, sem_post etc.) is used. linux and Darwin support both System

[HACKERS] what are clog and xlog?

2010-12-05 Thread flyusa2010 fly
Hi, folks, I'm a newbie to postgres. I'm confused with xlog and clog. To my initial understanding, xlog is the periodic checkpoint log for data, while clog is for commit log (very unclear for me ...) Thanks!

Re: [HACKERS] disk caching for writing log

2010-12-05 Thread flyusa2010 fly
Thanks for your reply. Yes, i mean disk may lie to os. On Fri, Dec 3, 2010 at 12:14 PM, Stefan Kaltenbrunner wrote: > On 12/03/2010 06:43 PM, Heikki Linnakangas wrote: > >> On 03.12.2010 13:49, flyusa2010 fly wrote: >> >>> When writing log, dbms should synchrono

[HACKERS] disk caching for writing log

2010-12-03 Thread flyusa2010 fly
When writing log, dbms should synchronously flush log to disk. I'm wondering, if it is possible that the logs are in disk cache, while the control is returned to dbms again, so dbms thinks logs are persistent on disk. In this case, if the disk fails, then there's incorrectness for dbms log writing,