Original query:

SELECT "main"."oid" "oid", "main"."name" "name", (COALESCE("fields"."fields", 0)) "fields", (COALESCE("ind"."indexes", 0)) "indexes", (COALESCE("constraints"."constraints", 0) + COALESCE("constraints2"."constraints", 0)) "constraints", "main"."rows" "rows", (((("main"."relpages" + (CASE "main"."reltoastrelid" WHEN 0 THEN 0 ELSE COALESCE((SELECT SUM("relpages") FROM "pg_class" "toa" WHERE "oid" = "main"."reltoastrelid"), 0) + COALESCE((SELECT SUM("relpages") FROM "pg_class" "toa" WHERE "oid" IN (SELECT "indexrelid" FROM "pg_index" WHERE "indrelid" = "main"."reltoastrelid")), 0) END))) + COALESCE("ind"."relpages", 0)) * 8192) "size", "main"."datasize" "datasize", "main"."seqscans" "seqscans", "main"."idxscans" "idxscans", "main"."idxscanrate" "idxscanrate", "main"."hotrate" "hotrate", "main"."deadrate" "deadrate", "main"."relpages" "relpages", "main"."reltoastrelid" "reltoastrelid"
FROM (SELECT "main"."oid" "oid", "main"."relname" "name", ("main"."reltuples"::bigint) "rows", ("main"."relpages" * 8192) "datasize", "sta"."seq_scan" "seqscans", (COALESCE("sta"."idx_scan", 0)) "idxscans", (COALESCE(("sta"."idx_scan" * 100 / ("sta"."seq_scan" + "sta"."idx_scan" + 0.000001)), 0)) "idxscanrate", (CASE WHEN "sta"."n_tup_upd" <> 0 THEN "sta"."n_tup_hot_upd" * 100 / "sta"."n_tup_upd" END) "hotrate", ("sta"."n_dead_tup" * 100 / ("sta"."n_dead_tup" + "main"."reltuples" + 0.000001)) "deadrate", "main"."relpages" "relpages", "main"."reltoastrelid" "reltoastrelid"
FROM "pg_class" "main"
INNER JOIN "pg_stat_all_tables" "sta" ON "sta"."relid" = "main"."oid"
WHERE ("main"."relnamespace" = (CURRENT_SCHEMA()::regnamespace) AND "main"."relkind" = 'r' AND "sta"."schemaname" = (CURRENT_SCHEMA()))
ORDER BY "main"."relname", "main"."oid"
LIMIT 100) "main"
LEFT JOIN (SELECT (COUNT(*)) "indexes", (SUM("cls"."relpages")) "relpages", "ind"."indrelid" "ID"
FROM "pg_index" "ind"
INNER JOIN "pg_class" "cls" ON "cls"."oid" = "ind"."indexrelid"
WHERE "cls"."relnamespace" = (CURRENT_SCHEMA()::regnamespace)
GROUP BY "ind"."indrelid") "ind" ON "ind"."ID" = "main"."oid"
LEFT JOIN (SELECT (COUNT(*)) "fields", "attrelid" "ID"
FROM "pg_attribute" "att"
WHERE ("att"."attrelid" IN (SELECT "oid" FROM "pg_class" WHERE "relnamespace" = (CURRENT_SCHEMA()::regnamespace)) AND "att"."attnum" > 0 AND NOT "att"."attisdropped")
GROUP BY "attrelid") "fields" ON "fields"."ID" = "main"."oid"
LEFT JOIN LATERAL (SELECT (COUNT(*)) "constraints"
FROM "pg_constraint" "con"
WHERE "conrelid" = "main"."oid") "constraints" ON TRUE
LEFT JOIN LATERAL (SELECT (COUNT(*)) "constraints"
FROM "pg_constraint" "con"
WHERE "contypid" IN (SELECT "atttypid" FROM "pg_attribute" WHERE ("attrelid" = "main"."oid" AND "attnum" > 0 AND NOT "attisdropped"))) "constraints2" ON TRUE
ORDER BY "main"."name", "main"."oid"

Prettified:

SELECT
  "main"."oid" AS oid,
  "main"."name" AS name,
  COALESCE("fields"."fields", 0) AS fields,
  COALESCE("ind"."indexes", 0) AS indexes,
  COALESCE("constraints"."constraints", 0) + COALESCE("constraints2"."constraints", 0) AS constraints,
  "main"."rows" AS rows,
  (("main"."relpages" + CASE "main"."reltoastrelid" WHEN 0 THEN 0 ELSE COALESCE((SELECT sum("relpages") FROM "pg_class" toa WHERE "oid" = "main"."reltoastrelid"), 0) + COALESCE((SELECT sum("relpages") FROM "pg_class" toa WHERE "oid" IN (SELECT "indexrelid" FROM "pg_index" WHERE "indrelid" = "main"."reltoastrelid")), 0) END) + COALESCE("ind"."relpages", 0)) * 8192 AS size,
  "main"."datasize" AS datasize,
  "main"."seqscans" AS seqscans,
  "main"."idxscans" AS idxscans,
  "main"."idxscanrate" AS idxscanrate,
  "main"."hotrate" AS hotrate,
  "main"."deadrate" AS deadrate,
  "main"."relpages" AS relpages,
  "main"."reltoastrelid" AS reltoastrelid
FROM
  (
    SELECT
      "main"."oid" AS oid,
      "main"."relname" AS name,
      "main"."reltuples"::bigint AS rows,
      "main"."relpages" * 8192 AS datasize,
      "sta"."seq_scan" AS seqscans,
      COALESCE("sta"."idx_scan", 0) AS idxscans,
      COALESCE(("sta"."idx_scan" * 100) / (("sta"."seq_scan" + "sta"."idx_scan") + 0.000001), 0) AS idxscanrate,
      CASE
        WHEN "sta"."n_tup_upd" <> 0 THEN ("sta"."n_tup_hot_upd" * 100) / "sta"."n_tup_upd"
      END AS hotrate,
      ("sta"."n_dead_tup" * 100) / (("sta"."n_dead_tup" + "main"."reltuples") + 0.000001) AS deadrate,
      "main"."relpages" AS relpages,
      "main"."reltoastrelid" AS reltoastrelid
    FROM
      "pg_class" main
      JOIN "pg_stat_all_tables" sta ON ("sta"."relid" = "main"."oid")
    WHERE
      "main"."relnamespace" = current_schema()::regnamespace AND
      "main"."relkind" = 'r' AND
      "sta"."schemaname" = current_schema()
    ORDER BY
      "main"."relname",
      "main"."oid"
    LIMIT
      100
  ) main
  LEFT JOIN (
    SELECT
      count(*) AS indexes,
      sum("cls"."relpages") AS relpages,
      "ind"."indrelid" AS ID
    FROM
      "pg_index" ind
      JOIN "pg_class" cls ON ("cls"."oid" = "ind"."indexrelid")
    WHERE
      "cls"."relnamespace" = current_schema()::regnamespace
    GROUP BY
      "ind"."indrelid"
  ) ind ON ("ind"."ID" = "main"."oid")
  LEFT JOIN (
    SELECT
      count(*) AS fields,
      "attrelid" AS ID
    FROM
      "pg_attribute" att
    WHERE
      "att"."attrelid" IN (SELECT "oid" FROM "pg_class" WHERE "relnamespace" = current_schema()::regnamespace) AND
      "att"."attnum" > 0 AND
      NOT "att"."attisdropped"
    GROUP BY
      "attrelid"
  ) fields ON ("fields"."ID" = "main"."oid")
  LEFT JOIN (
    SELECT
      count(*) AS constraints
    FROM
      "pg_constraint" con
    WHERE
      "conrelid" = "main"."oid"
  ) constraints ON true
  LEFT JOIN (
    SELECT
      count(*) AS constraints
    FROM
      "pg_constraint" con
    WHERE
      "contypid" IN (SELECT "atttypid" FROM "pg_attribute" WHERE "attrelid" = "main"."oid" AND "attnum" > 0 AND NOT "attisdropped")
  ) constraints2 ON true
ORDER BY
  "main"."name",
  "main"."oid"