Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB4d6-0001YT-EE for pgsql-admin@arkaria.postgresql.org; Mon, 01 Apr 2019 21:38:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hB4d5-00055g-1m for pgsql-admin@arkaria.postgresql.org; Mon, 01 Apr 2019 21:38:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB4d4-00055Z-PY for pgsql-admin@lists.postgresql.org; Mon, 01 Apr 2019 21:38:06 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([2404:130:4080::4]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB4cz-0000C6-Le for pgsql-admin@lists.postgresql.org; Mon, 01 Apr 2019 21:38:04 +0000 Received: from [IPv6:2406:e001:80b:3f01:81ad:a7cc:752e:99dc] (unknown [IPv6:2406:e001:80b:3f01:81ad:a7cc:752e:99dc]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id 6F69781425; Tue, 2 Apr 2019 10:37:51 +1300 (NZDT) Subject: Re: Materialize view in slave server To: Mahmoud Moharam , Pgsql-admin References: From: Mark Kirkwood Message-ID: <60d328b9-5713-e1a9-f6cf-d33fa9d79ba8@catalyst.net.nz> Date: Tue, 2 Apr 2019 10:37:50 +1300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Authentication-Results: ORIGINATING; auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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