rules use lztext - initdb required

From: wieck(at)debis(dot)com (Jan Wieck)
To: pgsql-hackers(at)postgreSQL(dot)org (PostgreSQL HACKERS)
Subject: rules use lztext - initdb required
Date: 1999-11-18 13:57:36
Message-ID: m11oS48-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)debis(dot)com (Jan Wieck) #

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ricardo Coelho 1999-11-18 14:21:24 Change your own password
Previous Message Jan Wieck 1999-11-18 12:13:38 Re: [HACKERS] LZ compressing data type