MPP wrapper of Postgres Admin UDFs

28 views
Skip to first unread message

Zhenghua Lyu

unread,
Jul 5, 2023, 10:30:18 AM7/5/23
to gpdb...@greenplum.org
Hi all,
      Postgres provide some catalog UDFs to help DBA.
      Examples are:
  • pg_relation_filepath
  • pg_stat_file
  • pg_relation_filenode
  • pg_filenode_relation
  • ...
      There are some proposals that Greenplum provide MPP-wrapper version ones.
   
      Like gp_relation_filepath can output all results from all segments.

      The usage is like:
           select gp_relation_filepath(tab::regclass);
       
       It is not easy to use it in target list of a SQL with from exprs in GPDB:
           select gp_relation_filepath(tab::regclass) from pg_class

       It needs carefully design to implement the above usage. Similar topic: 
       https://groups.google.com/a/greenplum.org/g/gpdb-dev/c/DkTx4O-kuH0 (pg_relation_size in Greenplum)

     Question:

       Do we still need to introduce gp_relation_filepath​ that can only be used like 
       select gp_relation_filepath(tab::regclass);​ (with empty from expr in the SQL).

       Thanks!

Best,
Zhenghua

Julien

unread,
Aug 2, 2023, 9:27:40 PM8/2/23
to Greenplum Developers, Zhenghua Lyu
Hi

As I mentioned before, this class of function is mostly helpful when used in a plain statement, for instance to get all the filenodes (on all the segments for gpdb) for e.g. relation with a name starting with 'a%' or something like that.  Both implementations suggested at https://github.com/greenplum-db/gpdb/pull/15596 are incompatible with such a usage, and would greatly limit those functions usefulness.

Ashwin Agrawal

unread,
Aug 3, 2023, 9:32:17 PM8/3/23
to Julien, Greenplum Developers, Zhenghua Lyu
Thank you for the inputs. For now let's not speculate on use cases and add MPP versions of these functions.
Let's wait, learn the usage patterns and pains around them and then we decide the path forward.

--
Ashwin Agrawal (VMware)
Reply all
Reply to author
Forward
0 new messages