pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Materialize view in slave server
3+ messages / 3 participants
[nested] [flat]

* Materialize view in slave server
@ 2019-04-01 15:02  Mahmoud Moharam <mmoharam@lucidya.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Mahmoud Moharam @ 2019-04-01 15:02 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hello All ,
hope every thing is well with you all ,
I planned to run stream replication (primary / slave) on my environment ,
and want to make writes on primary and reads from slave , so the question
is :- I have Materialize view running on primary , what is the best choose
to run Materialize view on primary or on slave ?

thanks all

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Materialize view in slave server
@ 2019-04-01 15:32  Frank Alberto Rodriguez <franknigth@gmail.com>
  parent: Mahmoud Moharam <mmoharam@lucidya.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Frank Alberto Rodriguez @ 2019-04-01 15:32 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hello. If you planned to writes over materialized views, you should use  the 
primary server, because the slave must be to read only.
If you want to avoid writes in the slave, use normal views instead, otherwise 
ensure the writes over a materialized view occur in a primary node only, but 
reading it on slave node would not be a problem.

Regards 

On lunes, 1 de abril de 2019 09:02:13 CST Mahmoud Moharam wrote:
> Hello All ,
> hope every thing is well with you all ,
> I planned to run stream replication (primary / slave) on my environment ,
> and want to make writes on primary and reads from slave , so the question
> is :- I have Materialize view running on primary , what is the best choose
> to run Materialize view on primary or on slave ?
> 
> thanks all









^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Materialize view in slave server
@ 2019-04-01 21:37  Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
  parent: Mahmoud Moharam <mmoharam@lucidya.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Mark Kirkwood @ 2019-04-01 21:37 UTC (permalink / raw)
  To: Mahmoud Moharam <mmoharam@lucidya.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

If you use logical replication, you can create the materialized view on 
the slave. Which is *better* (master or slave) - depends on whether you 
want to have as many reads as possible coming from the slave, and also 
details like how much lag (i.e how much out of date) your slave is.

regards

Mark

On 2/04/19 4:02 AM, Mahmoud Moharam wrote:
> Hello All ,
> hope every thing is well with you all ,
> I planned to run stream replication (primary / slave) on my 
> environment , and want to make writes on primary and reads from slave 
> , so the question is :- I have Materialize view running on primary , 
> what is the best choose to run Materialize view on primary or on slave ?
>
> thanks all





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-04-01 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 15:02 Materialize view in slave server Mahmoud Moharam <mmoharam@lucidya.com>
2019-04-01 15:32 ` Frank Alberto Rodriguez <franknigth@gmail.com>
2019-04-01 21:37 ` Mark Kirkwood <mark.kirkwood@catalyst.net.nz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox