Re: BUG #14635: Query is executed slower on hot standby slave database then on master database

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Vitaliy Gomenyuk <vgomenyuk(at)callfire(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, Aleksandr Saraseka <asaraseka(at)callfire(dot)com>
Subject: Re: BUG #14635: Query is executed slower on hot standby slave database then on master database
Date: 2017-05-19 15:41:06
Message-ID: CAMkU=1zoRF8obz=tQcNguQTNPmgZ1T_Uc6-D-E9nPxM6Amf-tw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, May 18, 2017 at 9:26 AM, Vitaliy Gomenyuk <vgomenyuk(at)callfire(dot)com>
wrote:

>
> 2. I'm not sure that the problem is with not WAL-logged hint bits,
> because due to my next investigation:
> 2.0. We have two equal servers for master and slave database (CPU, RAM,
> HDD).
> 2.1. On master database I'm running a query, it executes in 138.116 ms
> 2.2. On a hot-standby slave database with working replication process
> I'm running the same query, it executes in 1623.496 ms (much slower)
> 2.3. Then on that hot-standby slave database I've created a trigger
> file, which stops a replication process immediately and right after that,
> I'm running the same query, it executes in 132.354 ms (fast like on
> master).
>
2.4. During the time when I'm creating a trigger file (less then 1
> second), indexes in that table can't be changed. Even more, that slave
> hot-standby database was created from the full master copy just before I
> started test. So master and slave databases are equal. One difference is
> turned on replication process in a hot-standby mode. So only a replication
> process can cause this behaviour.
>

If the index hint bits were set on the master and then a base backup is
taken, then those bits are set on the replica created from that backup.
But it does not use the index hint bits while it is in hot standby mode.
But when it is promoted, it will start using them.

> But why and how to improve the situation?
>

Vacuum your table (on the master).

Cheers,

Jeff

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2017-05-19 15:47:13 Re: BUG #14661: authentication behavior(SCRAM-MD5)
Previous Message asotolongo 2017-05-19 15:05:11 BUG #14661: authentication behavior(SCRAM-MD5)