Thread: Is it good to have toast table for information schema table?

Is it good to have toast table for information schema table?

From
AI Rumman
Date:
Hi,

Is it good to have toast table for information schema table? I am using Postgresql 8.4 and current state is:

select datname, datfrozenxid from pg_database;           
  datname  | datfrozenxid 
-----------+--------------
 template1 |   1462730397
 template0 |   1462741467
 postgres  |   1562754912
 jangles   |   1459615432
(4 rows)


select * from pg_class  where relfrozenxid  = 1459615432;
    relname     | reltoastidxid | relhasindex | relfrozenxid 
----------------+---------------+-------------+--------------
 pg_toast_11447 |         11451 | t           |   1459615432 
(1 row)


select 11447::regclass;                                  
            regclass             
---------------------------------
 information_schema.sql_features
(1 row)

Please advice.

Thanks.

Re: Is it good to have toast table for information schema table?

From
Adrian Klaver
Date:
On 04/22/2014 04:58 PM, AI Rumman wrote:
> Hi,
>
> Is it good to have toast table for information schema table? I am using
> Postgresql 8.4 and current state is:
>
> *select datname, datfrozenxid from pg_database; *
>    datname  | datfrozenxid
> -----------+--------------
>   template1 |   1462730397
>   template0 |   1462741467
>   postgres  |   1562754912
>   jangles   |   1459615432
> (4 rows)
> *
> *
> *
> *
> *select * from pg_class  where relfrozenxid  = 1459615432;*
>      relname     | reltoastidxid | relhasindex | relfrozenxid
> ----------------+---------------+-------------+--------------
>   pg_toast_11447 |         11451 | t           |   1459615432
> (1 row)
> *
> *
> *
> *
> *select 11447::regclass; *
>              regclass
> ---------------------------------
>   information_schema.sql_features
> (1 row)
>
> Please advice.

A TOAST table is used whenever the actual table has variable length
fields that meet certain criteria:

http://www.postgresql.org/docs/9.3/static/storage-toast.html

information_schema.sql_features schema is:

test=# \d information_schema.sql_features
              Table "information_schema.sql_features"
       Column      |               Type                | Modifiers
------------------+-----------------------------------+-----------
  feature_id       | information_schema.character_data |
  feature_name     | information_schema.character_data |
  sub_feature_id   | information_schema.character_data |
  sub_feature_name | information_schema.character_data |
  is_supported     | information_schema.yes_or_no      |
  is_verified_by   | information_schema.character_data |
  comments         | information_schema.character_data |

 From here you see character_data is not fixed length:

http://www.postgresql.org/docs/9.3/static/infoschema-datatypes.html

so a TOAST table is not out of order.

I see it on my database also.

>
> Thanks.


--
Adrian Klaver
adrian.klaver@aklaver.com