Use TableAm API in pg_table_size - Mailing list pgsql-hackers

From Georgios
Subject Use TableAm API in pg_table_size
Date
Msg-id qzfAa10e5AbhOq0M7O4g-uXfn0E-sKyL1W6Lj6-4Eifz0bujH6OGYqBDvmo9wx3T1Twau-3z3PL383IL4NQPQ9oPj6IJYJgfboeuTB0FJM0=@protonmail.com
Whole thread Raw
List pgsql-hackers
Hi,

I noticed that there are several file layout assumptions in dbsize.c which might not hold true for non heap relations attached with the TableAm API. It seems logical that in order to retrieve the disk size of a relation, the existing size method to be used instead.

A small patch is included to demonstrate how such an implementation can look like. Also, the existing method for heap, table_block_relation_size, should be able to address the valid cases where a fork number does not exist.

If this is considered valid, then the same can be applied for indexes too. The more generic calculate_relation_size can be adapted to call into the TableAm for those kinds of relations that makes sense. If agreed, a more complete patch can be provided.

Cheers,
//Georgios


Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: snowball ASCII stemmer configuration
Next
From: Marc Cousin
Date:
Subject: slow get_actual_variable_range with long running transactions