Re: [BUGS] BUG #4919: CREATE USER command slows down system performance

От: Alvaro Herrera
Тема: Re: [BUGS] BUG #4919: CREATE USER command slows down system performance
Дата: ,
Msg-id: 20090808185929.GA9155@alvh.no-ip.org
(см: обсуждение, исходный текст)
Ответ на: Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane)
Ответы: Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane)
Список: pgsql-performance

Скрыть дерево обсуждения

Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Alvaro Herrera, )
 Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Alvaro Herrera, )
  Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane, )
   Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Marko Kreen, )
    Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (David Wilson, )
     Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane, )
     Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Marko Kreen, )
   Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Bruce Momjian, )
    Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane, )
     Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Alvaro Herrera, )
      Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane, )
       Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane, )
        Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Alvaro Herrera, )
         Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane, )
          Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Alvaro Herrera, )
           Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Tom Lane, )
     Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (Bruce Momjian, )
 Re: [BUGS] BUG #4919: CREATE USER command slows down system performance  (toruvinn, )
 Re: [BUGS] BUG #4919: CREATE USER command slows down systemperformance  ("Lauris Ulmanis", )

Tom Lane wrote:

> Actually, I had forgotten that we were using the pg_database flatfile
> for purposes other than authentication checks.  In particular, we need
> it during backend startup to map from database name to database OID,
> without which it's impossible to locate the system catalogs for the
> target database.  It's pretty hard to see a way around that one.
> We could grovel through pg_database itself, as indeed is done to rebuild
> the flatfile during system start.  But that's certainly not going to be
> fast in cases where there are enough DBs to make the flatfile slow.

Also, IIRC flatfiles were introduced precisely to avoid having to read
the catalogs manually.

> So on third thought, Alvaro's right: the only real solution here is to
> adopt a more efficient representation of the flat files.  Maybe some
> sort of simple hashtable arrangement would work.  (Rendering them not so
> flat anymore...)

As long as there's a simple API, there should be no problem.

(Except that it would be nice to be able to build the file incrementally
...  If we have to write out a million lines each time a millionth user
is created, there will still be a bottleneck at CREATE USER time.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


В списке pgsql-performance по дате сообщения:

От: Bruce Momjian
Дата:
Сообщение: Re: [BUGS] BUG #4919: CREATE USER command slows down system performance
От: Robert Haas
Дата:
Сообщение: Re: Need suggestions on kernel settings for dedicated FreeBSD/Postgresql machine