Re: TOAST (was: BLOB)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: TOAST (was: BLOB)
Дата
Msg-id 14004.956501865@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: TOAST (was: BLOB)  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-sql
Peter Eisentraut <peter_e@gmx.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 | cidr1042 |
bpchar1043| varchar1560 | bit1562 | varbit1625 | lztext1700 | 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   |    161042 | bpchar  |    221043 | varchar |    141560 | bit     |    151562 | varbit  |    151625 | lztext  |
 121700 | numeric |    45
 
(11 rows)

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


В списке pgsql-sql по дате отправления:

Предыдущее
От: mig@utdt.edu
Дата:
Сообщение: Returning sets from functions?
Следующее
От: mig@utdt.edu
Дата:
Сообщение: Re: Returning sets from functions?