1. 10 2月, 2017 1 次提交
    • J
      Simplify and speed up Postgres query for primary_keys · d6529af2
      Jordan Lewis 提交于
      primary_keys(table) needs to query various metadata tables in Postgres to
      determine the primary key for the table. Previously, it did so using a
      complex common table expression against pg_constraint and pg_attribute.
      
      This patch simplifies the query by joining pg_index against pg_attribute
      instead of going through pg_constraint. This avoids an expensive unnest,
      window function query, and common table expression.
      
      EXPLAINing these queries in Postgres against a database with a single
      table with a composite primary key shows a 66% reduction in the plan and
      execute latencies. This is significant during application startup time,
      especially against very large schemas, where these queries would be even
      slower and more numerous.
      
      Closes #27949
      d6529af2
  2. 09 2月, 2017 7 次提交
  3. 08 2月, 2017 10 次提交
  4. 07 2月, 2017 21 次提交
  5. 06 2月, 2017 1 次提交