Re: [SQL] RewriteDefine.c : Rule size - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] RewriteDefine.c : Rule size
Date
Msg-id 2314.931530245@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] RewriteDefine.c : Rule size  (Jim Rowan <jmr@computing.com>)
Responses Re: [SQL] RewriteDefine.c : Rule size  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [SQL] RewriteDefine.c : Rule size  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-sql
Jim Rowan <jmr@computing.com> writes:
> First we multiplied it * 4.  This improved the ability to handle complex
> rules, but didn't go far enough... (it still wouldn't handle all of what we
> wanted it to). 

> So we multiplied it * 8.  Initdb complained about "float4 not
> defined".

There is a poorly-documented restriction that BLCKSZ can't exceed 32K
(IIRC, this is because block offsets are stored in signed shorts somewhere).
Probably would be a good idea to mention this in the comments in
config.h.in.

For the long run it would be nice to remove the restriction.  I have no
idea whether that would be easy or hard.  Ideally we could do something
like

#if BLCKSZ > 32767typedef int BlockOffset;
#elsetypedef short BlockOffset;
#endif

but finding all the places that need to use the typedef might be a pain.
        regards, tom lane


pgsql-sql by date:

Previous
From: "John Ridout"
Date:
Subject: RE: [SQL] Good Optimization
Next
From: Bruce Momjian
Date:
Subject: Re: [SQL] Good Optimization