Re: changing MyDatabaseId

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: changing MyDatabaseId
Дата
Msg-id AANLkTin+Sg_hV5tBDNLPgKR+-YELjdv2g7Xv0uKVLj28@mail.gmail.com
обсуждение исходный текст
Ответ на Re: changing MyDatabaseId  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: changing MyDatabaseId  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Wed, Nov 17, 2010 at 4:52 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> However, that test doesn't capture everything.  For example, imagine a
> connection pooler sitting in front of PG.  Rebinding to a new database
> means disconnecting a TCP connection and establishing a new one.
> Switching databases might save some latency there even if we don't
> actually save much in terms of CPU instructions.  Maybe that's not
> important, though.  I don't know.  I don't want to let my theorizing
> get too far ahead of the data.

Everything you said is true but there's more. A freshly created
backend needs to build relcache entries and for every relation in your
query. A reused connection eventually warms up the relcache and
syscaches and can plan new queries using them without doing any
syscalls. And of course if it's a query that's already been planned
might be able to reuse the entire plan structure without replanning
it.


--
greg


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Teodor Sigaev
Дата:
Сообщение: Re: GiST insert algorithm rewrite
Следующее
От: Teodor Sigaev
Дата:
Сообщение: Re: GiST insert algorithm rewrite