diff --git a/CHANGELOG.md b/CHANGELOG.md index 543bb0ce6..5ec07dd73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - #955, Support configurable aud claim - @statik - #996, Fix embedded column conflicts table name - @grotsev - #974, Fix RPC error when function has single OUT param - @steve-chavez +- #1021, Reduce join size in allColumns for faster program start - @nextstopsun ## [0.4.3.0] - 2017-09-06 diff --git a/src/PostgREST/DbStructure.hs b/src/PostgREST/DbStructure.hs index eae70fd8a..25b024b75 100644 --- a/src/PostgREST/DbStructure.hs +++ b/src/PostgREST/DbStructure.hs @@ -364,7 +364,7 @@ allColumns tabs = AND n.nspname NOT IN ('pg_catalog', 'information_schema', $1) ), /* - -- CTE based on information_schema.columns + -- CTE based on information_schema.columns -- changed: -- remove the owner filter -- limit columns to the ones in the api schema or PK/FK columns @@ -458,7 +458,7 @@ allColumns tabs = JOIN pg_namespace nbt ON bt.typnamespace = nbt.oid) ON t.typtype = 'd'::"char" AND t.typbasetype = bt.oid LEFT JOIN (pg_collation co JOIN pg_namespace nco ON co.collnamespace = nco.oid) ON a.attcollation = co.oid AND (nco.nspname <> 'pg_catalog'::name OR co.collname <> 'default'::name) - WHERE + WHERE NOT pg_is_other_temp_schema(nc.oid) AND a.attnum > 0 AND NOT a.attisdropped