title: Why postgres database server slows down after dump/restore with --no-owner option?
body: <p>When I do dump/restore everything works fine. But when I add option <code>--no-owner</code> and dump/restore database the queries slows down.<br />
  For example one complex query run about <strong>3 minues instead of 1sec</strong> before dump/restore</p>
  <p><strong>The only thing that is changed is <code>--no-owner</code> for <code>pg_dump</code> utility</strong></p>
  <p>I suppose when dump with <code>--no-owner</code> option and restore such database then user, which restore database, has no access to index info. But this is just assumption</p>
  <p><strong>DETAILS</strong><br />
  <code>make docker-dbdump &amp;&amp; make docker-dbrestore</code> slows down query execution:</p>
  <pre class="lang-sh prettyprint-override"><code>.ONESHELL:
  docker-dbdump:
      file=${APP_ROOT}/db/${DB_NAME}-$$(date &quot;+%Y-%m-%d_%H-%M-%S&quot;).sql.gz
      docker exec ${DOCKER_CONTAINER} pg_dump --no-owner -U postgres ${DB_NAME} \
        | gzip -f &gt; $${file}
      cp $${file} ${APP_ROOT}/db/${DB_NAME}.sql.gz
  
  docker-dbrestore: dbclear
      zcat ${APP_ROOT}/db/${DB_NAME}.sql.gz | \
          docker exec -i ${DOCKER_CONTAINER} psql -U ${DB_USER} -d ${DB_NAME}
  </code></pre>
  <p>When I remove <code>--no-owner</code> options then everything is fine.</p>
  <p><strong>UPD</strong></p>
  <pre><code>ERROR:  permission denied to create extension &quot;btree_gist&quot;
  HINT:  Must be superuser to create this extension.
  ERROR:  extension &quot;btree_gist&quot; does not exist
  ...
  ERROR:  data type integer has no default operator class for access method &quot;gist&quot;
  HINT:  You must specify an operator class for the index or define a default operator class for the data type.
  </code></pre>
  <p>I want to compare how database is dumped with and w/o <code>--no-owner</code> option and show later today</p>