public inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Yugo NAGATA <nagata@sraoss.co.jp>
To: jian he <jian.universality@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Incremental View Maintenance, take 2
Date: Mon, 28 Aug 2023 01:12:41 +0900
Message-ID: <20230828011241.2d7ee9f96ac9a386e1eb0423@sraoss.co.jp> (raw)
In-Reply-To: <CACJufxHMG9Pmc=W8QMHvk_RwUBABDZNh9HgO4JSQtp1+JUPTJg@mail.gmail.com>
References: <20230601235909.0e1572c27e59112f9d0cbe86@sraoss.co.jp>
	<20230601034703.9e4f81f5d92ae6e3949b84d2@sraoss.co.jp>
	<CACJufxE8Kct5=c1KKi_JgP09WApCk0Myk6=a5xo05_J_mB7hRQ@mail.gmail.com>
	<20230628170604.505955118ac2f91abd554f13@sraoss.co.jp>
	<CACJufxEA-V+0Fa3Q6xQrFwG6wLs4DsX7E4exdfA=rO-70svmBw@mail.gmail.com>
	<CACJufxHZkF_e4JvcXCfaYkOSs0p6-S2SFQk1+iOHdDL6kvngKg@mail.gmail.com>
	<CACJufxHtG9h_1V2pr+Hx9amWE9fW0z3dcW9t8yMiBgiSsEjBQA@mail.gmail.com>
	<CACJufxHVrgBM1FhM7=df9Cky_uPJ8o3wTjT0iKJWDgmbYPTYqw@mail.gmail.com>
	<CACJufxHJQ-Tvxyj1Fy5O3ULXn912bnF1pHfCmLTR72Qcy2_-iQ@mail.gmail.com>
	<CACJufxHMG9Pmc=W8QMHvk_RwUBABDZNh9HgO4JSQtp1+JUPTJg@mail.gmail.com>

On Sun, 2 Jul 2023 08:25:12 +0800
jian he <jian.universality@gmail.com> wrote:

> This is probably not trivial.
> In function  apply_new_delta_with_count.
> 
>  appendStringInfo(&querybuf,
> "WITH updt AS (" /* update a tuple if this exists in the view */
> "UPDATE %s AS mv SET %s = mv.%s OPERATOR(pg_catalog.+) diff.%s "
> "%s " /* SET clauses for aggregates */
> "FROM %s AS diff "
> "WHERE %s " /* tuple matching condition */
> "RETURNING %s" /* returning keys of updated tuples */
> ") INSERT INTO %s (%s)" /* insert a new tuple if this doesn't existw */
> "SELECT %s FROM %s AS diff "
> "WHERE NOT EXISTS (SELECT 1 FROM updt AS mv WHERE %s);",
> 
> ---------------------
> ") INSERT INTO %s (%s)" /* insert a new tuple if this doesn't existw */
> "SELECT %s FROM %s AS diff "
> 
> the INSERT INTO line, should have one white space in the end?
> also "existw" should be "exists"

Yes, we should need a space although it works. I'll fix as well as the typo.
Thank you.

Regards,
Yugo Nagata

-- 
Yugo NAGATA <nagata@sraoss.co.jp>






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nagata@sraoss.co.jp, jian.universality@gmail.com
  Subject: Re: Incremental View Maintenance, take 2
  In-Reply-To: <20230828011241.2d7ee9f96ac9a386e1eb0423@sraoss.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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