title: Rails 6 and Oracle 11 XE: Why is the schema/structure dump so slow?
body: <p>I'm using Rails 6 with <code>activerecord-oracle_enhanced-adapter</code> adapter for Oracle 11 XE database.
  At the beginning of the project I was working with Postgres, but due to customer requirements I had to migrate to Oracle.</p>
  <p>My question is very similar to <a href="https://stackoverflow.com/questions/592444/rails-rake-dbmigrate-very-slow-on-oracle">Rails: rake db:migrate *very* slow on Oracle</a>, but it's from 11 years ago, i'm using the updated version of the adapter.</p>
  <p>I know that after all migrations are applied to database then rake db:migrate calls db:schema:dump task to generate schema.rb file from current database schema. I only have one schema, with many tables (around 90)</p>
  <p>The answer for the previous question was something like</p>
  <blockquote>
  <p>One way how to debug this issue would be if you would put some debug
  messages in oracle_enhanced_adapter.rb file so that you could identify
  which method calls are taking so long time.</p>
  </blockquote>
  <pre><code>== 20200820164111 RemoveSemesterFromProject: migrated (0.1347s) ===============
  real    13m26,038s
  user    0m5,494s
  sys 0m0,401s
  </code></pre>
  <p>All migrations finished in an reasonable time, so I think the error occurs in the following action &quot;db: schema: dump&quot; but i don't have oracle_enchaced_adapter.rb neither oracle_enhanced_adapter.rb, so i don't know where to look at.</p>
  <p>What can i do for improve this behaviour?</p>
  <p><strong>[EDIT]:</strong></p>
  <p>Time that takes when i run <code>db:schema:dump</code></p>
  <pre><code>real    9m44,074s
  user    0m3,701s
  sys 0m0,327s
  </code></pre>
  <p>and this is the time that takes when i run <code>db:structure:dump</code></p>
  <pre><code>real    21m40,073s
  user    0m5,046s
  sys 0m0,413s
  
  </code></pre>