Skip to content

Instantly share code, notes, and snippets.

@jeaye

jeaye/outlier Secret

Last active October 11, 2017 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeaye/65b9d35839d5152118fde4fbe78e6c19 to your computer and use it in GitHub Desktop.
Save jeaye/65b9d35839d5152118fde4fbe78e6c19 to your computer and use it in GitHub Desktop.
00:00:38.259855 | 48.4% | 421,709 | 00:00:00 |
SELECT typinput=?::regproc, typtype
FROM pg_catalog.pg_type
LEFT JOIN (
select ns.oid as nspoid, ns.nspname, r.r
from pg_namespace as ns
join (
select s.r, (current_schemas(?))[s.r] as nspname
from generate_series(?, array_upper(current_schemas(?), ?)) as s(r)
) as r
using ( nspname )
) as sp
ON sp.nspoid = typnamespace
WHERE typname = $1
ORDER BY sp.r, pg_type.oid
DESC LIMIT ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment