Re: TOAST (was: BLOB)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Jan Wieck <wieck(at)debis(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: TOAST (was: BLOB)
Date: 2000-04-23 14:57:45
Message-ID: 14004.956501865@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> What datatypes besides text'ish and binary data'ish do you want to toast?
> SQL(3) only defines CLOB and BLOB, so they might be thinking along my
> lines. I mean surely having toastable polygons and numerics has some
> theoretical value but is it worth bothering?

Good point. The only possible candidates for toasting are varlena
types, which are

select oid,typname from pg_type
where typtype='b' and typlen < 0 and typname !~ '^_';
oid | typname
------+---------
17 | bytea
25 | text
32 | SET
602 | path
604 | polygon
705 | unknown
869 | inet
650 | cidr
1042 | bpchar
1043 | varchar
1560 | bit
1562 | varbit
1625 | lztext
1700 | numeric
(14 rows)

plus array types (of which there are lots, but only one set of access
routines needs to deal with toasting). I find it hard to foresee any
need for toasted inet/cidr data ;-), and I'm not even sure what SET is.
And unknown is just a placeholder, and lztext is going away anyway.
So I'd say we have

MUSTs: bytea, text, bpchar, varchar, arrays

WANTs: bit, varbit, numeric

LOW PRIORITY: path, polygon

which is not so many types after all... although some of these are used
by a lot of routines:

select pg_type.oid,typname,count(*) from pg_type, pg_proc
where typtype='b' and typlen < 0 and typname !~ '^_' and pg_type.oid
in (proargtypes[0],proargtypes[1],proargtypes[2],proargtypes[3],
proargtypes[4],proargtypes[5],proargtypes[6],proargtypes[7])
group by pg_type.oid,typname;
oid | typname | count
------+---------+-------
17 | bytea | 6
25 | text | 88
602 | path | 29
604 | polygon | 24
869 | inet | 16
1042 | bpchar | 22
1043 | varchar | 14
1560 | bit | 15
1562 | varbit | 15
1625 | lztext | 12
1700 | numeric | 45
(11 rows)

(This is an overestimate since routines with multiple arguments may be
counted in more than one category...)

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message mig 2000-04-23 15:02:01 Re: Returning sets from functions?
Previous Message mig 2000-04-23 14:15:20 Returning sets from functions?