exec-ddl
CREATE TABLE pg_class (
    oid oid PRIMARY KEY,
    relname text NOT NULL,
    relnamespace oid NOT NULL,
    reltype oid NOT NULL,
    relowner oid NOT NULL,
    relam oid NOT NULL,
    relfilenode oid NOT NULL,
    reltablespace oid NOT NULL,
    relpages bigint NOT NULL,
    reltuples double precision NOT NULL,
    relallvisible bigint NOT NULL,
    reltoastrelid oid NOT NULL,
    relhasindex boolean NOT NULL,
    relisshared boolean NOT NULL,
    relpersistence text NOT NULL,
    relistemp boolean NOT NULL,
    relkind text NOT NULL,
    relnatts bigint NOT NULL,
    relchecks bigint NOT NULL,
    relhasoids boolean NOT NULL,
    relhaspkey boolean NOT NULL,
    relhasrules boolean NOT NULL,
    relhastriggers boolean NOT NULL,
    relhassubclass boolean NOT NULL,
    relfrozenxid bigint NOT NULL,
    relacl text[],
    reloptions text[],
    UNIQUE INDEX pg_class_relname_nsp_index (relname, relnamespace),
    INDEX pg_class_tblspc_relfilenode_index (reltablespace, relfilenode)
);
----

exec-ddl
CREATE TABLE pg_namespace (
    oid oid PRIMARY KEY,
    nspname text NOT NULL,
    nspowner oid NOT NULL,
    nspacl text[],
    UNIQUE INDEX pg_namespace_nspname_index (nspname)
);
----

exec-ddl
CREATE TABLE pg_tablespace (
    oid oid PRIMARY KEY,
    spcname text NOT NULL,
    spcowner oid NOT NULL,
    spclocation text NOT NULL,
    spcacl text[],
    spcoptions text[],
    UNIQUE INDEX pg_tablespace_spcname_index (spcname)
);
----

exec-ddl
CREATE TABLE pg_inherits (
    inhrelid oid NOT NULL,
    inhparent oid NOT NULL,
    inhseqno bigint NOT NULL,
    PRIMARY KEY (inhrelid, inhseqno),
    INDEX pg_inherits_parent_index (inhparent)
);
----

exec-ddl
CREATE TABLE pg_index (
    indexrelid oid PRIMARY KEY,
    indrelid oid NOT NULL,
    indnatts bigint NOT NULL,
    indisunique boolean NOT NULL,
    indisprimary boolean NOT NULL,
    indisexclusion boolean NOT NULL,
    indimmediate boolean NOT NULL,
    indisclustered boolean NOT NULL,
    indisvalid boolean NOT NULL,
    indcheckxmin boolean NOT NULL,
    indisready boolean NOT NULL,
    indislive boolean NOT NULL,
    indisreplident boolean NOT NULL,
    indkey bigint[] NOT NULL,
    indcollation bigint NOT NULL,
    indclass bigint NOT NULL,
    indoption bigint NOT NULL,
    indexprs text,
    indpred text,
    INDEX pg_index_indrelid_index (indrelid)
)
----

exec-ddl
CREATE TABLE pg_foreign_table (
    ftrelid oid PRIMARY KEY,
    ftserver oid NOT NULL,
    ftoptions text[]
);
----

exec-ddl
CREATE TABLE pg_foreign_server (
    oid oid PRIMARY KEY,
    srvname text NOT NULL,
    srvowner oid NOT NULL,
    srvfdw oid NOT NULL,
    srvtype text,
    srvversion text,
    srvacl text[],
    srvoptions text[],
    UNIQUE INDEX pg_foreign_server_name_index (srvname)
);
----

opt
SELECT
    c.oid,
    n.nspname AS schemaname,
    c.relname AS tablename,
    c.relacl,
    pg_get_userbyid(c.relowner) AS tableowner,
    obj_description(c.oid) AS description,
    c.relkind,
    ci.relname AS cluster,
    c.relhasoids AS hasoids,
    c.relhasindex AS hasindexes,
    c.relhasrules AS hasrules,
    t.spcname AS tablespace,
    c.reloptions AS param,
    c.relhastriggers AS hastriggers,
    c.relpersistence AS unlogged,
    ft.ftoptions,
    fs.srvname,
    c.reltuples,
    ((SELECT count(*) FROM pg_inherits WHERE inhparent = c.oid) > 0) AS inhtable,
    i2.nspname AS inhschemaname,
    i2.relname AS inhtablename
FROM pg_class AS c
LEFT JOIN pg_namespace AS n
ON n.oid = c.relnamespace
LEFT JOIN pg_tablespace AS t
ON t.oid = c.reltablespace
LEFT JOIN
(
    pg_inherits AS i
    INNER JOIN pg_class AS c2
    ON i.inhparent = c2.oid
    LEFT JOIN pg_namespace AS n2
    ON n2.oid = c2.relnamespace
) AS i2
ON i2.inhrelid = c.oid
LEFT JOIN pg_index AS ind
ON (ind.indrelid = c.oid) AND (ind.indisclustered = 't')
LEFT JOIN pg_class AS ci
ON ci.oid = ind.indexrelid
LEFT JOIN pg_foreign_table AS ft
ON ft.ftrelid = c.oid
LEFT JOIN pg_foreign_server AS fs
ON ft.ftserver = fs.oid
WHERE ((c.relkind = 'r'::CHAR) OR (c.relkind = 'f'::CHAR)) AND (n.nspname = 'public')
ORDER BY schemaname, tablename
----
sort
 ├── columns: oid:1!null schemaname:31!null tablename:2!null relacl:26 tableowner:173 description:190 relkind:17!null cluster:106 hasoids:20!null hasindexes:13!null hasrules:22!null tablespace:37 param:27 hastriggers:23!null unlogged:15!null ftoptions:136 srvname:140 reltuples:10!null inhtable:191!null inhschemaname:79 inhtablename:50
 ├── immutable
 ├── fd: ()-->(31), (1)-->(2,10,13,15,17,20,22,23,26,27,37), (2)-->(1,10,13,15,17,20,22,23,26,27,37)
 ├── ordering: +2 opt(31) [actual: +2]
 └── project
      ├── columns: tableowner:173 description:190 inhtable:191!null c.oid:1!null c.relname:2!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.nspname:31!null spcname:37 c2.relname:50 n2.nspname:79 ci.relname:106 ftoptions:136 srvname:140
      ├── immutable
      ├── fd: ()-->(31), (1)-->(2,10,13,15,17,20,22,23,26,27,37), (2)-->(1,10,13,15,17,20,22,23,26,27,37)
      ├── group-by (hash)
      │    ├── columns: c.oid:1!null c.relname:2!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.nspname:31!null spcname:37 c2.relname:50 n2.nspname:79 ci.relname:106 ftoptions:136 srvname:140 count_rows:154!null column172:172 description:189 rownum:192!null
      │    ├── grouping columns: rownum:192!null
      │    ├── immutable
      │    ├── key: (192)
      │    ├── fd: ()-->(31), (1)-->(2,10,13,15,17,20,22,23,26,27,37), (2)-->(1,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,10,13,15,17,20,22,23,26,27,31,37,50,79,106,136,140,154,172,189)
      │    ├── right-join (hash)
      │    │    ├── columns: c.oid:1!null c.relname:2!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.nspname:31!null spcname:37 c2.relname:50 n2.nspname:79 ci.relname:106 ftoptions:136 srvname:140 pg_inherits.inhparent:150 column172:172 description:189 rownum:192!null
      │    │    ├── immutable
      │    │    ├── fd: ()-->(31), (1)-->(2,10,13,15,17,20,22,23,26,27,37), (2)-->(1,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,10,13,15,17,20,22,23,26,27,37,50,79,106,136,140,172,189)
      │    │    ├── scan pg_inherits
      │    │    │    └── columns: pg_inherits.inhparent:150!null
      │    │    ├── distinct-on
      │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.nspname:31!null spcname:37 c2.relname:50 n2.nspname:79 ci.relname:106 ftoptions:136 srvname:140 column172:172 description:189 rownum:192!null
      │    │    │    ├── grouping columns: rownum:192!null
      │    │    │    ├── immutable
      │    │    │    ├── key: (192)
      │    │    │    ├── fd: ()-->(31), (1)-->(2,10,13,15,17,20,22,23,26,27,37), (2)-->(1,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,10,13,15,17,20,22,23,26,27,31,37,50,79,106,136,140,172,189)
      │    │    │    ├── right-join (hash)
      │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.nspname:31!null spcname:37 c2.relname:50 n2.nspname:79 ci.relname:106 ftoptions:136 srvname:140 column172:172 objoid:186 description:189 rownum:192!null
      │    │    │    │    ├── immutable
      │    │    │    │    ├── fd: ()-->(31), (1)-->(2,10,13,15,17,20,22,23,26,27,37), (2)-->(1,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,10,13,15,17,20,22,23,26,27,37,50,79,106,136,140,172)
      │    │    │    │    ├── union-all
      │    │    │    │    │    ├── columns: objoid:186!null description:189!null
      │    │    │    │    │    ├── left columns: crdb_internal.kv_catalog_comments.objoid:177 crdb_internal.kv_catalog_comments.description:179
      │    │    │    │    │    ├── right columns: crdb_internal.kv_builtin_function_comments.oid:181 crdb_internal.kv_builtin_function_comments.description:182
      │    │    │    │    │    ├── immutable
      │    │    │    │    │    ├── project
      │    │    │    │    │    │    ├── columns: crdb_internal.kv_catalog_comments.objoid:177!null crdb_internal.kv_catalog_comments.description:179!null
      │    │    │    │    │    │    ├── immutable
      │    │    │    │    │    │    └── select
      │    │    │    │    │    │         ├── columns: crdb_internal.kv_catalog_comments.objoid:177!null crdb_internal.kv_catalog_comments.description:179!null objsubid:185!null
      │    │    │    │    │    │         ├── immutable
      │    │    │    │    │    │         ├── fd: ()-->(185)
      │    │    │    │    │    │         ├── project
      │    │    │    │    │    │         │    ├── columns: objsubid:185!null crdb_internal.kv_catalog_comments.objoid:177!null crdb_internal.kv_catalog_comments.description:179!null
      │    │    │    │    │    │         │    ├── immutable
      │    │    │    │    │    │         │    ├── select
      │    │    │    │    │    │         │    │    ├── columns: crdb_internal.kv_catalog_comments.classoid:176!null crdb_internal.kv_catalog_comments.objoid:177!null crdb_internal.kv_catalog_comments.objsubid:178!null crdb_internal.kv_catalog_comments.description:179!null
      │    │    │    │    │    │         │    │    ├── scan kv_catalog_comments
      │    │    │    │    │    │         │    │    │    └── columns: crdb_internal.kv_catalog_comments.classoid:176!null crdb_internal.kv_catalog_comments.objoid:177!null crdb_internal.kv_catalog_comments.objsubid:178!null crdb_internal.kv_catalog_comments.description:179!null
      │    │    │    │    │    │         │    │    └── filters
      │    │    │    │    │    │         │    │         └── crdb_internal.kv_catalog_comments.classoid:176 != 4294967077 [outer=(176), constraints=(/176: (/NULL - /4294967076] [/4294967078 - ]; tight)]
      │    │    │    │    │    │         │    └── projections
      │    │    │    │    │    │         │         └── crdb_internal.kv_catalog_comments.objsubid:178::INT8 [as=objsubid:185, outer=(178), immutable]
      │    │    │    │    │    │         └── filters
      │    │    │    │    │    │              └── objsubid:185 = 0 [outer=(185), constraints=(/185: [/0 - /0]; tight), fd=()-->(185)]
      │    │    │    │    │    └── scan kv_builtin_function_comments
      │    │    │    │    │         └── columns: crdb_internal.kv_builtin_function_comments.oid:181!null crdb_internal.kv_builtin_function_comments.description:182!null
      │    │    │    │    ├── project
      │    │    │    │    │    ├── columns: column172:172 c.oid:1!null c.relname:2!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.nspname:31!null spcname:37 c2.relname:50 n2.nspname:79 ci.relname:106 ftoptions:136 srvname:140 rownum:192!null
      │    │    │    │    │    ├── immutable
      │    │    │    │    │    ├── key: (192)
      │    │    │    │    │    ├── fd: ()-->(31), (1)-->(2,10,13,15,17,20,22,23,26,27,37), (2)-->(1,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,10,13,15,17,20,22,23,26,27,37,50,79,106,136,140,172)
      │    │    │    │    │    ├── distinct-on
      │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relowner:5!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.nspname:31!null spcname:37 c2.relname:50 n2.nspname:79 ci.relname:106 ftoptions:136 srvname:140 rolname:158 rownum:192!null
      │    │    │    │    │    │    ├── grouping columns: rownum:192!null
      │    │    │    │    │    │    ├── key: (192)
      │    │    │    │    │    │    ├── fd: ()-->(31), (1)-->(2,5,10,13,15,17,20,22,23,26,27,37), (2)-->(1,5,10,13,15,17,20,22,23,26,27,37), (192)-->(1,2,5,10,13,15,17,20,22,23,26,27,31,37,50,79,106,136,140,158)
      │    │    │    │    │    │    ├── right-join (hash)
      │    │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 pg_catalog.pg_roles.oid:157 rolname:158 rownum:192!null
      │    │    │    │    │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1,2,5,8,10,13,15,17,20,22,23,26,27,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140), (3)==(30), (30)==(3), (45)==(49), (49)==(45)
      │    │    │    │    │    │    │    ├── scan pg_roles
      │    │    │    │    │    │    │    │    └── columns: pg_catalog.pg_roles.oid:157 rolname:158
      │    │    │    │    │    │    │    ├── ordinality
      │    │    │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 rownum:192!null
      │    │    │    │    │    │    │    │    ├── key: (192)
      │    │    │    │    │    │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (192)-->(1-3,5,8,10,13,15,17,20,22,23,26,27,30,31,36,37,44,45,49-51,78,79,84,85,91,105,106,134-136,139,140), (3)==(30), (30)==(3), (45)==(49), (49)==(45)
      │    │    │    │    │    │    │    │    └── left-join (lookup pg_namespace [as=n2])
      │    │    │    │    │    │    │    │         ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 n2.oid:78 n2.nspname:79 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140
      │    │    │    │    │    │    │    │         ├── key columns: [51] = [78]
      │    │    │    │    │    │    │    │         ├── lookup columns are key
      │    │    │    │    │    │    │    │         ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (36)-->(37), (37)-->(36), (49)-->(50,51), (50,51)-->(49), (78)~~>(79), (79)~~>(78), (84)-->(85), (105)-->(106), (134)-->(135,136), (139)-->(140), (140)-->(139), (3)==(30), (30)==(3), (45)==(49), (49)==(45)
      │    │    │    │    │    │    │    │         ├── right-join (hash)
      │    │    │    │    │    │    │    │         │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 i.inhrelid:44 i.inhparent:45 c2.oid:49 c2.relname:50 c2.relnamespace:51 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140
      │    │    │    │    │    │    │    │         │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (84)-->(85), (1,84)-->(91,105,106), (105)-->(106), (49)-->(50,51), (50,51)-->(49), (36)-->(37), (37)-->(36), (45)==(49), (49)==(45), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    ├── inner-join (hash)
      │    │    │    │    │    │    │    │         │    │    ├── columns: i.inhrelid:44!null i.inhparent:45!null c2.oid:49!null c2.relname:50!null c2.relnamespace:51!null
      │    │    │    │    │    │    │    │         │    │    ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more)
      │    │    │    │    │    │    │    │         │    │    ├── fd: (49)-->(50,51), (50,51)-->(49), (45)==(49), (49)==(45)
      │    │    │    │    │    │    │    │         │    │    ├── scan pg_inherits [as=i]
      │    │    │    │    │    │    │    │         │    │    │    └── columns: i.inhrelid:44!null i.inhparent:45!null
      │    │    │    │    │    │    │    │         │    │    ├── scan pg_class@pg_class_relname_nsp_index [as=c2]
      │    │    │    │    │    │    │    │         │    │    │    ├── columns: c2.oid:49!null c2.relname:50!null c2.relnamespace:51!null
      │    │    │    │    │    │    │    │         │    │    │    ├── key: (49)
      │    │    │    │    │    │    │    │         │    │    │    └── fd: (49)-->(50,51), (50,51)-->(49)
      │    │    │    │    │    │    │    │         │    │    └── filters
      │    │    │    │    │    │    │    │         │    │         └── i.inhparent:45 = c2.oid:49 [outer=(45,49), constraints=(/45: (/NULL - ]; /49: (/NULL - ]), fd=(45)==(49), (49)==(45)]
      │    │    │    │    │    │    │    │         │    ├── left-join (lookup pg_class [as=ci])
      │    │    │    │    │    │    │    │         │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 indexrelid:84 indrelid:85 indisclustered:91 ci.oid:105 ci.relname:106 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140
      │    │    │    │    │    │    │    │         │    │    ├── key columns: [84] = [105]
      │    │    │    │    │    │    │    │         │    │    ├── lookup columns are key
      │    │    │    │    │    │    │    │         │    │    ├── key: (1,84)
      │    │    │    │    │    │    │    │         │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (84)-->(85), (1,84)-->(36,37,91,105,106), (105)-->(106), (36)-->(37), (37)-->(36), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    │    ├── left-join (lookup pg_index [as=ind])
      │    │    │    │    │    │    │    │         │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 indexrelid:84 indrelid:85 indisclustered:91 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140
      │    │    │    │    │    │    │    │         │    │    │    ├── key columns: [966] = [84]
      │    │    │    │    │    │    │    │         │    │    │    ├── lookup columns are key
      │    │    │    │    │    │    │    │         │    │    │    ├── second join in paired joiner
      │    │    │    │    │    │    │    │         │    │    │    ├── key: (1,84)
      │    │    │    │    │    │    │    │         │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (84)-->(85), (1,84)-->(36,37,91), (36)-->(37), (37)-->(36), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    │    │    ├── left-join (lookup pg_index@pg_index_indrelid_index [as=ind])
      │    │    │    │    │    │    │    │         │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140 indexrelid:966 indrelid:967 continuation:987
      │    │    │    │    │    │    │    │         │    │    │    │    ├── key columns: [1] = [967]
      │    │    │    │    │    │    │    │         │    │    │    │    ├── first join in paired joiner; continuation column: continuation:987
      │    │    │    │    │    │    │    │         │    │    │    │    ├── key: (1,966)
      │    │    │    │    │    │    │    │         │    │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (36)-->(37), (37)-->(36), (966)-->(967,987), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    │    │    │    ├── left-join (lookup pg_tablespace [as=t])
      │    │    │    │    │    │    │    │         │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null t.oid:36 spcname:37 ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140
      │    │    │    │    │    │    │    │         │    │    │    │    │    ├── key columns: [8] = [36]
      │    │    │    │    │    │    │    │         │    │    │    │    │    ├── lookup columns are key
      │    │    │    │    │    │    │    │         │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │         │    │    │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,36,37,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (36)-->(37), (37)-->(36), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    │    │    │    │    ├── left-join (lookup pg_foreign_server [as=fs])
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null ftrelid:134 ftserver:135 ftoptions:136 fs.oid:139 srvname:140
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    ├── key columns: [135] = [139]
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    ├── lookup columns are key
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136,139,140), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136,139,140), (139)~~>(140), (140)~~>(139), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    ├── left-join (lookup pg_foreign_table [as=ft])
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null ftrelid:134 ftserver:135 ftoptions:136
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    ├── key columns: [1] = [134]
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    ├── lookup columns are key
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27,134-136), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (134)-->(135,136), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    ├── inner-join (hash)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27 n.oid:30!null n.nspname:31!null
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    ├── multiplicity: left-rows(zero-or-one), right-rows(zero-or-more)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    ├── fd: ()-->(3,30,31), (1)-->(2,5,8,10,13,15,17,20,22,23,26,27), (2)-->(1,5,8,10,13,15,17,20,22,23,26,27), (3)==(30), (30)==(3)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── fd: (1)-->(2,3,5,8,10,13,15,17,20,22,23,26,27), (2,3)-->(1,5,8,10,13,15,17,20,22,23,26,27)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── scan pg_class [as=c]
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    │    ├── columns: c.oid:1!null c.relname:2!null c.relnamespace:3!null c.relowner:5!null c.reltablespace:8!null c.reltuples:10!null c.relhasindex:13!null c.relpersistence:15!null c.relkind:17!null c.relhasoids:20!null c.relhasrules:22!null c.relhastriggers:23!null c.relacl:26 c.reloptions:27
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    │    ├── key: (1)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    │    └── fd: (1)-->(2,3,5,8,10,13,15,17,20,22,23,26,27), (2,3)-->(1,5,8,10,13,15,17,20,22,23,26,27)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │         └── (c.relkind:17 = 'r') OR (c.relkind:17 = 'f') [outer=(17), constraints=(/17: [/'f' - /'f'] [/'r' - /'r']; tight)]
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    ├── scan pg_namespace@pg_namespace_nspname_index [as=n]
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── columns: n.oid:30!null n.nspname:31!null
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── constraint: /31: [/'public' - /'public']
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── cardinality: [0 - 1]
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    ├── key: ()
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    │    └── fd: ()-->(30,31)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    │         └── n.oid:30 = c.relnamespace:3 [outer=(3,30), constraints=(/3: (/NULL - ]; /30: (/NULL - ]), fd=(3)==(30), (30)==(3)]
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    │         │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    │         │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    │         │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    │         │    │    │    └── filters
      │    │    │    │    │    │    │    │         │    │    │         └── indisclustered:91 [outer=(91), constraints=(/91: [/true - /true]; tight), fd=()-->(91)]
      │    │    │    │    │    │    │    │         │    │    └── filters (true)
      │    │    │    │    │    │    │    │         │    └── filters
      │    │    │    │    │    │    │    │         │         └── i.inhrelid:44 = c.oid:1 [outer=(1,44), constraints=(/1: (/NULL - ]; /44: (/NULL - ]), fd=(1)==(44), (44)==(1)]
      │    │    │    │    │    │    │    │         └── filters (true)
      │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │         └── pg_catalog.pg_roles.oid:157 = c.relowner:5 [outer=(5,157), constraints=(/5: (/NULL - ]; /157: (/NULL - ]), fd=(5)==(157), (157)==(5)]
      │    │    │    │    │    │    └── aggregations
      │    │    │    │    │    │         ├── const-agg [as=c.oid:1, outer=(1)]
      │    │    │    │    │    │         │    └── c.oid:1
      │    │    │    │    │    │         ├── const-agg [as=c.relname:2, outer=(2)]
      │    │    │    │    │    │         │    └── c.relname:2
      │    │    │    │    │    │         ├── const-agg [as=c.relowner:5, outer=(5)]
      │    │    │    │    │    │         │    └── c.relowner:5
      │    │    │    │    │    │         ├── const-agg [as=c.reltuples:10, outer=(10)]
      │    │    │    │    │    │         │    └── c.reltuples:10
      │    │    │    │    │    │         ├── const-agg [as=c.relhasindex:13, outer=(13)]
      │    │    │    │    │    │         │    └── c.relhasindex:13
      │    │    │    │    │    │         ├── const-agg [as=c.relpersistence:15, outer=(15)]
      │    │    │    │    │    │         │    └── c.relpersistence:15
      │    │    │    │    │    │         ├── const-agg [as=c.relkind:17, outer=(17)]
      │    │    │    │    │    │         │    └── c.relkind:17
      │    │    │    │    │    │         ├── const-agg [as=c.relhasoids:20, outer=(20)]
      │    │    │    │    │    │         │    └── c.relhasoids:20
      │    │    │    │    │    │         ├── const-agg [as=c.relhasrules:22, outer=(22)]
      │    │    │    │    │    │         │    └── c.relhasrules:22
      │    │    │    │    │    │         ├── const-agg [as=c.relhastriggers:23, outer=(23)]
      │    │    │    │    │    │         │    └── c.relhastriggers:23
      │    │    │    │    │    │         ├── const-agg [as=c.relacl:26, outer=(26)]
      │    │    │    │    │    │         │    └── c.relacl:26
      │    │    │    │    │    │         ├── const-agg [as=c.reloptions:27, outer=(27)]
      │    │    │    │    │    │         │    └── c.reloptions:27
      │    │    │    │    │    │         ├── const-agg [as=n.nspname:31, outer=(31)]
      │    │    │    │    │    │         │    └── n.nspname:31
      │    │    │    │    │    │         ├── const-agg [as=spcname:37, outer=(37)]
      │    │    │    │    │    │         │    └── spcname:37
      │    │    │    │    │    │         ├── const-agg [as=c2.relname:50, outer=(50)]
      │    │    │    │    │    │         │    └── c2.relname:50
      │    │    │    │    │    │         ├── const-agg [as=n2.nspname:79, outer=(79)]
      │    │    │    │    │    │         │    └── n2.nspname:79
      │    │    │    │    │    │         ├── const-agg [as=ci.relname:106, outer=(106)]
      │    │    │    │    │    │         │    └── ci.relname:106
      │    │    │    │    │    │         ├── const-agg [as=ftoptions:136, outer=(136)]
      │    │    │    │    │    │         │    └── ftoptions:136
      │    │    │    │    │    │         ├── const-agg [as=srvname:140, outer=(140)]
      │    │    │    │    │    │         │    └── srvname:140
      │    │    │    │    │    │         └── first-agg [as=rolname:158, outer=(158)]
      │    │    │    │    │    │              └── rolname:158
      │    │    │    │    │    └── projections
      │    │    │    │    │         └── assignment-cast: STRING [as=column172:172, outer=(5,158), immutable]
      │    │    │    │    │              └── COALESCE(rolname:158, (('unknown (OID=' || c.relowner:5) || ')')::NAME)
      │    │    │    │    └── filters
      │    │    │    │         └── objoid:186 = c.oid:1 [outer=(1,186), constraints=(/1: (/NULL - ]; /186: (/NULL - ]), fd=(1)==(186), (186)==(1)]
      │    │    │    └── aggregations
      │    │    │         ├── const-agg [as=c.oid:1, outer=(1)]
      │    │    │         │    └── c.oid:1
      │    │    │         ├── const-agg [as=c.relname:2, outer=(2)]
      │    │    │         │    └── c.relname:2
      │    │    │         ├── const-agg [as=c.reltuples:10, outer=(10)]
      │    │    │         │    └── c.reltuples:10
      │    │    │         ├── const-agg [as=c.relhasindex:13, outer=(13)]
      │    │    │         │    └── c.relhasindex:13
      │    │    │         ├── const-agg [as=c.relpersistence:15, outer=(15)]
      │    │    │         │    └── c.relpersistence:15
      │    │    │         ├── const-agg [as=c.relkind:17, outer=(17)]
      │    │    │         │    └── c.relkind:17
      │    │    │         ├── const-agg [as=c.relhasoids:20, outer=(20)]
      │    │    │         │    └── c.relhasoids:20
      │    │    │         ├── const-agg [as=c.relhasrules:22, outer=(22)]
      │    │    │         │    └── c.relhasrules:22
      │    │    │         ├── const-agg [as=c.relhastriggers:23, outer=(23)]
      │    │    │         │    └── c.relhastriggers:23
      │    │    │         ├── const-agg [as=c.relacl:26, outer=(26)]
      │    │    │         │    └── c.relacl:26
      │    │    │         ├── const-agg [as=c.reloptions:27, outer=(27)]
      │    │    │         │    └── c.reloptions:27
      │    │    │         ├── const-agg [as=n.nspname:31, outer=(31)]
      │    │    │         │    └── n.nspname:31
      │    │    │         ├── const-agg [as=spcname:37, outer=(37)]
      │    │    │         │    └── spcname:37
      │    │    │         ├── const-agg [as=c2.relname:50, outer=(50)]
      │    │    │         │    └── c2.relname:50
      │    │    │         ├── const-agg [as=n2.nspname:79, outer=(79)]
      │    │    │         │    └── n2.nspname:79
      │    │    │         ├── const-agg [as=ci.relname:106, outer=(106)]
      │    │    │         │    └── ci.relname:106
      │    │    │         ├── const-agg [as=ftoptions:136, outer=(136)]
      │    │    │         │    └── ftoptions:136
      │    │    │         ├── const-agg [as=srvname:140, outer=(140)]
      │    │    │         │    └── srvname:140
      │    │    │         ├── const-agg [as=column172:172, outer=(172)]
      │    │    │         │    └── column172:172
      │    │    │         └── first-agg [as=description:189, outer=(189)]
      │    │    │              └── description:189
      │    │    └── filters
      │    │         └── pg_inherits.inhparent:150 = c.oid:1 [outer=(1,150), constraints=(/1: (/NULL - ]; /150: (/NULL - ]), fd=(1)==(150), (150)==(1)]
      │    └── aggregations
      │         ├── count [as=count_rows:154, outer=(150)]
      │         │    └── pg_inherits.inhparent:150
      │         ├── const-agg [as=c.oid:1, outer=(1)]
      │         │    └── c.oid:1
      │         ├── const-agg [as=c.relname:2, outer=(2)]
      │         │    └── c.relname:2
      │         ├── const-agg [as=c.reltuples:10, outer=(10)]
      │         │    └── c.reltuples:10
      │         ├── const-agg [as=c.relhasindex:13, outer=(13)]
      │         │    └── c.relhasindex:13
      │         ├── const-agg [as=c.relpersistence:15, outer=(15)]
      │         │    └── c.relpersistence:15
      │         ├── const-agg [as=c.relkind:17, outer=(17)]
      │         │    └── c.relkind:17
      │         ├── const-agg [as=c.relhasoids:20, outer=(20)]
      │         │    └── c.relhasoids:20
      │         ├── const-agg [as=c.relhasrules:22, outer=(22)]
      │         │    └── c.relhasrules:22
      │         ├── const-agg [as=c.relhastriggers:23, outer=(23)]
      │         │    └── c.relhastriggers:23
      │         ├── const-agg [as=c.relacl:26, outer=(26)]
      │         │    └── c.relacl:26
      │         ├── const-agg [as=c.reloptions:27, outer=(27)]
      │         │    └── c.reloptions:27
      │         ├── const-agg [as=n.nspname:31, outer=(31)]
      │         │    └── n.nspname:31
      │         ├── const-agg [as=spcname:37, outer=(37)]
      │         │    └── spcname:37
      │         ├── const-agg [as=c2.relname:50, outer=(50)]
      │         │    └── c2.relname:50
      │         ├── const-agg [as=n2.nspname:79, outer=(79)]
      │         │    └── n2.nspname:79
      │         ├── const-agg [as=ci.relname:106, outer=(106)]
      │         │    └── ci.relname:106
      │         ├── const-agg [as=ftoptions:136, outer=(136)]
      │         │    └── ftoptions:136
      │         ├── const-agg [as=srvname:140, outer=(140)]
      │         │    └── srvname:140
      │         ├── const-agg [as=column172:172, outer=(172)]
      │         │    └── column172:172
      │         └── const-agg [as=description:189, outer=(189)]
      │              └── description:189
      └── projections
           ├── column172:172 [as=tableowner:173, outer=(172)]
           ├── description:189 [as=description:190, outer=(189)]
           └── count_rows:154 > 0 [as=inhtable:191, outer=(154)]
