Re: parametric block size? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: parametric block size?
Date
Msg-id 20140722172205.GT11811@eldon.alvh.no-ip.org
Whole thread Raw
In response to parametric block size?  (Fabien <coelho@cri.ensmp.fr>)
Responses Re: parametric block size?  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: parametric block size?  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Fabien wrote:

> ISTM that a desirable and reasonably simple to implement feature
> would be to be able to set the blocksize at "initdb" time, and
> "postgres" could use the value found in the database instead of a
> compile-time one.

I think you will find it more difficult to implement than it seems at
first.  For one thing, there are several macros that depend on the block
size and the algorithms involved cannot work with dynamic sizes;
consider MaxIndexTuplesPerPage which is used inPageIndexMultiDelete()
for instance.  That value is used to allocate an array in the stack, 
but that doesn't work if the array size is dynamic.  (Actually it works
almost everywhere, but that feature is not in C89 and thus it fails on
Windows).  That shouldn't be a problem, you say, just palloc() the array
-- except that that function is called within critical sections in some
places (e.g. _bt_delitems_vacuum) and you cannot use palloc there.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Some bogus results from prairiedog
Next
From: Robert Haas
Date:
Subject: Re: Portability issues in TAP tests