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

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: vgomenyuk(at)callfire(dot)com
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14635: Query is executed slower on hot standby slave database then on master database
Date: 2017-05-02 13:20:29
Message-ID: CAJrrPGcjNZO5UkexVfjF_CCBVrPtoY-iVvEYhP1n97z0ARWLoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Apr 28, 2017 at 11:38 PM, <vgomenyuk(at)callfire(dot)com> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 14635
> Logged by: Vitaliy Gomenyuk
> Email address: vgomenyuk(at)callfire(dot)com
> PostgreSQL version: 9.2.14
> Operating system: CentOS 6
> Description:
>
> Hello,
>
> We have two equal servers (CPU, RAM, HDD).
> We are using Postgresql 9.2.14 currently.
> Have setup master-slave streaming replication.
>
> Running next query at master and slave databases:
> explain analyze SELECT "om".* FROM "Table" AS "om" WHERE (om."UserID" =
> 11111) AND (NOT om."Deleted") AND (om."Status" = 0) ORDER BY "StampToSend"
> asc LIMIT 11;
> An execution plans are the same on master and slave databases.
>
> An execution time on master database: 138.116 ms
> An execution time on hot standby slave database with working replication:
> 1623.496 ms
> An execution time on slave database with turned off replication (after
> creating trigger file): 132.354 ms (equal to an execution time on master
> database).
>
> Why there is so huge difference in execution time between Postgresql with
> and without working streaming replication?
> How to improve the situation: to make an execution time on Hot standby
> slave
> dtabase with working replication equeal to master database?
>

Is the issue happening always or only sometimes?
can you please check explain plan output on both the machines with verbose
and buffers options.

explain (analyze, verbose, buffers) /*query*/

The explain output may help in identifying the plan of the query where it
is taking
more time compared to master.

Regards,
Hari Babu
Fujitsu Australia

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Eisentraut 2017-05-02 14:37:07 Re: Concurrent ALTER SEQUENCE RESTART Regression
Previous Message Robert Haas 2017-05-02 02:10:36 Re: Concurrent ALTER SEQUENCE RESTART Regression