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 1gpBcd-00017K-I5 for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jan 2019 12:39:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpBcc-0003ln-5z for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jan 2019 12:39:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpBcb-0003lg-Rn for pgsql-hackers@lists.postgresql.org; Thu, 31 Jan 2019 12:39:10 +0000 Received: from sraihb2.sra.co.jp ([202.32.10.6]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpBcY-0006BP-Gk for pgsql-hackers@postgresql.org; Thu, 31 Jan 2019 12:39:08 +0000 Received: from srascf.sra.co.jp (srascf [133.137.8.80]) by sraihb2.sra.co.jp (Postfix) with ESMTP id BEF9A2A161C for ; Thu, 31 Jan 2019 21:39:04 +0900 (JST) Received: from srascb.sra.co.jp (unknown [133.137.8.65]) by srascf.sra.co.jp with smtp id 4ffd_5986_dadd8e60_1e1e_4473_a310_538fb122c839; Thu, 31 Jan 2019 21:39:03 +0900 Received: from sranhm.sra.co.jp (osspc25 [133.137.174.97]) by srascb.sra.co.jp (Postfix) with ESMTP id 84A232D6943 for ; Thu, 31 Jan 2019 21:39:04 +0900 (JST) Received: from yugon-CFSV7-1 (sraihb-hub.sra.co.jp [133.137.8.6]) by sranhm.sra.co.jp (Postfix) with SMTP id 32C9CA107D; Thu, 31 Jan 2019 21:39:04 +0900 (JST) Date: Thu, 31 Jan 2019 21:38:58 +0900 From: Yugo Nagata To: =?UTF-8?B?Tmd1eeG7hW4gVHLhuqduIFF14buRYw==?= Vinh Cc: Adam Brusselback , denty , Pg Hackers Subject: Re: Implementing Incremental View Maintenance Message-Id: <20190131213858.210c22579d192e722d32ac2d@sraoss.co.jp> In-Reply-To: References: <20181227215726.4d166b4874f8983a641123f5@sraoss.co.jp> <1546252875009-0.post@n3.nabble.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 1 Jan 2019 14:46:25 +0700 Nguy=E1=BB=85n Tr=E1=BA=A7n Qu=E1=BB=91c Vinh wrot= e: > We have some result on incremental update for MVs. We generate triggers= on > C to do the incremental maintenance. We posted the code to github about= 1 > year ago, but unfortunately i posted a not-right ctrigger.h header. The > mistake was exposed to me when a person could not compile the generated > triggers and reported to me. And now i re-posted with the right ctrigge= r.h > file. >=20 > You can find the codes of the generator here: > https://github.com/ntqvinh/PgMvIncrementalUpdate/commits/master. You ca= n > find how did we do here: > https://link.springer.com/article/10.1134/S0361768816050066. The paper = is > about generating of codes in pl/pgsql. Anyway i see it is useful for > reading the codes. I don't know if i can share the paper or not so that= i > don't publish anywhere else. The text about how to generate triggers in= C > was published with open-access but unfortunately, it is in Vietnamese. >=20 > We are happy if the codes are useful for someone. I have read your paper. It is interesting and great so that the algorithm is described concretely. After reading this, I have a few questions about your implementation. Although I may be able to understand by reading your paper and code caref= ully, I would appreciate it if you could answer these. - It is said there are many limitations on the view definition query. How does this work when the query is not supported? - Is it possible to support materialized views that have DISTINCT, OUTER JOIN, or sub-query in your approach? - It is said that AVG is splitted to SUM and COUNT. Are these new additio= nal columns in MV visible for users? - Does this can handle the race condition discussed in [1], that is, if concurrent transactions update different two tables in the join view definition, is MV updated sucessfully? [1] https://www.postgresql.org/message-id/flat/1368561126.64093.YahooMail= Neo%40web162904.mail.bf1.yahoo.com Regards, --=20 Yugo Nagata