Re: query performance after database rename

Поиск
Список
Период
Сортировка
От Don Seiler
Тема Re: query performance after database rename
Дата
Msg-id CAHJZqBDofwpbRXLb=Lg32VafRxT8+pEwXR8NHY6Y1NRZBL7dYw@mail.gmail.com
обсуждение исходный текст
Ответ на AW: query performance after database rename  ("Zwettler Markus (OIZ)" <Markus.Zwettler@zuerich.ch>)
Ответы AW: query performance after database rename  ("Zwettler Markus (OIZ)" <Markus.Zwettler@zuerich.ch>)
Re: query performance after database rename  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Список pgsql-admin
On Wed, Nov 21, 2018 at 6:22 AM Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch> wrote:

Hi,

 

Customer claims about application slowdown after such an database exchange.

I will debug the cluster to get more in-depth in-sight.

No connection pooling used.

 

Thanks,

Markus

 

 

We have to exchange two databases db1 ó db2.

 

alter database [db1|db2] with allow_connections=false;

select pg_terminate_backend (pg_stat_activity.pid) from   pg_stat_activity where  pg_stat_activity.datname in ('db1', 'db2') and    pid <> pg_backend_pid();

alter database [db1|db2|temp] rename to [temp|db1|db2];

alter database [db1|db2] with allow_connections=true;

 

Version 9.6


Off the top of my head, I'd say after switching to a new database, you'd have a cold buffer cache. There's a possibility of old statistics. Are you syncing data changes from the old DB to the new DB?

Also, I'm curious *why* you're doing this.

--
Don Seiler
www.seiler.us

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

Предыдущее
От: David Modica
Дата:
Сообщение: RE: inserts take longer and longer
Следующее
От: "Zwettler Markus (OIZ)"
Дата:
Сообщение: AW: query performance after database rename