need a bit of help

need a bit of help

am 27.04.2006 00:21:27 von Warren Little

Hello,
got myself in a pickle with the database running out of space.

I have a question regarding pg_toast tables and their relationships to
the parent tables.

If I run the following query
select * from pg_class where
reltoastrelid like '%944' or reltoastidxid like '%944'

I receive a single row:
pg_toast_62130940,99,62130943,39934,0,62130942,0,7602767,3.0 4112e
+07,0,62130944,t,f,t,3,0,0,0,0,0,f,t,f,f,

which appears to be the pg_toast entry. Shouldn't there be a pg_class
whose reltoastrelid equals the reltoastidxid of the pg_toast instance

I'm trying to determine if I have some tuples that are not being
vacuumed.

thanks

--
Warren Little
Chief Technology Officer
Meridias Capital Inc
1018 W Atherton Dr
Salt Lake City, UT 84123
ph: 866.369.7763

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: need a bit of help

am 27.04.2006 01:22:26 von Tom Lane

Warren Little writes:
> which appears to be the pg_toast entry. Shouldn't there be a pg_class
> whose reltoastrelid equals the reltoastidxid of the pg_toast instance

No. The deal is

regular table's reltoastrelid points to OID of its toast table

toast table's reltoastidxid points to OID of its index

There's no "back links".

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Re: need a bit of help

am 27.04.2006 01:46:58 von Warren Little

ok

thanks

On Wed, 2006-04-26 at 19:22 -0400, Tom Lane wrote:
> Warren Little writes:
> > which appears to be the pg_toast entry. Shouldn't there be a pg_class
> > whose reltoastrelid equals the reltoastidxid of the pg_toast instance
>
> No. The deal is
>
> regular table's reltoastrelid points to OID of its toast table
>
> toast table's reltoastidxid points to OID of its index
>
> There's no "back links".
>
> regards, tom lane
--
Warren Little
Chief Technology Officer
Meridias Capital Inc
1018 W Atherton Dr
Salt Lake City, UT 84123
ph: 866.369.7763

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq