On Wed, 2007-12-05 at 23:20 -0500, Kris Jurka wrote:
> You need to consider the units. guc.c is in "number of pages", while
> postgresql.conf is in kB. Since the page size is 8192, these are
> equivalent.
I did consider that, but I'm not certain that it's that simple. Here's
why:
First, the default config for max_fsm_pages & _relations:
csb$ sudo -u postgres grep max_fsm /srv/postgresql-8.2/postgresql.conf
#max_fsm_pages = 1638400 # min max_fsm_relations*16, 6
bytes each
#max_fsm_relations = 1000 # min 100, ~70 bytes each
csb$ sudo rcpostgresql restart
Shutting down PostgreSQLserver stopped
Starting PostgreSQL
csb$ psql -d csb-dev -UPUBLIC -c "select name,setting from pg_settings
where name~'max_fsm'" -UPUBLIC
name | setting
-------------------+---------
max_fsm_pages | 20000
max_fsm_relations | 1000
(2 rows)
At the very least, this seems misleading to use different implied units.
But, the 8192 factor was obvious and I guessed that there was a page
size factor -- misleading but comprehensible.
I waded into this because I was having problems with vacuuming and
getting errors of the form "consider increasing the max_fsm_pages to X".
That warning is rather specific about what I should do, and X was in the
range of 400000-600000 for various tables, far below the apparent
default in postgresql.conf. I forged ahead, manually setting it to just
above the highest recommended value (and, confusingly, lower than the
apparent default). Then:
csb$ sudo -u postgres grep max_fsm /srv/postgresql-8.2/postgresql.conf
#max_fsm_pages = 1638400 # min max_fsm_relations*16, 6
bytes each
#max_fsm_relations = 1000 # min 100, ~70 bytes each
max_fsm_relations = 2500
max_fsm_pages = 400000
csb$ sudo rcpostgresql restart
Shutting down PostgreSQLserver stopped
Starting PostgreSQL
csb$ psql -d csb-dev -UPUBLIC -c "select name,setting from pg_settings
where name~'max_fsm'" -UPUBLIC
name | setting
-------------------+---------
max_fsm_pages | 400000
max_fsm_relations | 2500
(2 rows)
The implied default is written in page size units, but the manually set
default is in pages, as are the values shown by vacuum hints and
pg_settings.
So, it still seems to me that the postgresql.conf default (1638400)
should be written in page units (20000) to be consistent with the other
uses. Or, am I misthinking?
-Reece
--
Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0