Hi,
I just committed a little change to pg_rewrite.h and related
sources. Needs a new clean compile and initdb. Attributes
ev_qual and ev_action are now of type lztext (formerly text).
This one is impressive:
create table t1 (
typname name ,
typowner int4 ,
typlen int2 ,
typprtlen int2 ,
typbyval bool ,
typtype char ,
.
. (totally 54 attributes of various types)
.
atthasdef bool
);
CREATE
create view v1 as select * from t1;
CREATE 148540 1
select rulename, length(ev_action), octet_length(ev_action),
(100 - octet_length(ev_action) * 100 / length(ev_action))::text || '%'
as ratio
from pg_rewrite;
rulename |length|octet_length|ratio
--------------+------+------------+-----
_RETpg_user | 2683| 794|71%
_RETpg_rules | 2562| 934|64%
_RETpg_views | 3740| 1043|73%
_RETpg_tables | 4615| 1126|76%
_RETpg_indexes| 2639| 854|68%
_RETv1 | 14121| 1910|87%
(6 rows)
That means, the rule action string of the view v1 has an
original length of 14121 bytes and is stored in pg_rewrite in
1910 bytes only.
This should give us some room for complicated views/rules.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#========================================= wieck@debis.com (Jan Wieck) #