pg_upgrade fixes, #99 ;-)

Bruce Momjian <bruce@momjian.us>

From: Bruce Momjian <bruce@momjian.us>
To: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Date: 2011-01-08T18:53:15Z
Lists: pgsql-hackers

Attachments

In my first attached, applied patch, I have found a way to speed
relations lookups in pg_upgrade.  I knew there was a way to optimize
this but it was not clear until my major cleanups.  Instead of doing
effectively a nested loop join on old/new relations, I now order them
and use a 1:1 mergejoin.  This should speed up pg_upgrade for many
relations.

The second patch removes a hack for toast relations that is unnecessary
now that we always preserve pg_class.oid.  The old code preserved
relfilenodes for non-toast tables and oids for toast relations, which
was obviously confusing and non-optimal.

Remember, this code was not originally written by me but someone at
EnteprriseDB, so I didn't fully understand it until now.

I love removing functions!

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +