Re: Further pg_upgrade analysis for many tables

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Janes <jeff.janes@gmail.com>, Bruce Momjian <bruce@momjian.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Magnus Hagander <magnus@hagander.net>
Date: 2012-11-14T20:01:09Z
Lists: pgsql-hackers
Tom Lane escribió:
> Jeff Janes <jeff.janes@gmail.com> writes:

> > The next quadratic behavior is in init_sequence.
> 
> Yeah, that's another place that is using a linear list that perhaps
> should be a hashtable.  OTOH, probably most sessions don't touch enough
> different sequences for that to be a win.

Could we use some adaptive mechanism here?  Say we use a list for the
first ten entries, and if an eleventh one comes in, we create a hash
table for that one and all subsequent ones.  All future calls would
have to examine both the list for the first few and then the hash table.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services