Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sgI4H-000Ik9-UZ for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Aug 2024 06:10:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sgI4F-009hXI-Va for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Aug 2024 06:10:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sgI4F-009hWo-LG for pgsql-hackers@lists.postgresql.org; Tue, 20 Aug 2024 06:10:08 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sgI48-000YwI-TS for pgsql-hackers@postgresql.org; Tue, 20 Aug 2024 06:10:07 +0000 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2f1798eaee6so48056991fa.0 for ; Mon, 19 Aug 2024 23:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724134201; x=1724739001; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lZxvX72fdd5lGhraKyUbfhPdJj7opgUYNHlC1sBP3fk=; b=MwstHPwpMhjz1CmljqQbil5DEdXctglpxN8ABGjFcUKmBcj3qonXMkPOGpqauKOv2C 9egScJeyre9z/yAkHfuvdEzVxlTvuy+hprEAhWnc5gjITVYmYlXBOxUsCxc00AxEwA9F 42XmpCunvwyRNdQ+/5k1/FiXwGt79mcejuHqlVX5RYXQ+uX0zQ+vw68pmkvNIkno8wRR Rio55Bo/kxBvM3x4nIZ+H414gcJrkkIeZdReB3vCj7vIduQT/pymiDyfvxpFJ/acyWno GxuJNCFd2SB0xc3Fh4YhX5oISyODRpe683BvL9GqLiTCSOD8cyBYhq5z1RepQFBQVV8x 651g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724134201; x=1724739001; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lZxvX72fdd5lGhraKyUbfhPdJj7opgUYNHlC1sBP3fk=; b=bGyyWjhxwvntulZQ+YMmTldyItcJektE6mOrWUuaYZSld5Rda0kH9vL5NtdGXGxEb3 pqyKKtBM4JN/GPf2hzmw+siYXwjIs0oxtaykH8jWaJg9XRw7GIWZp+h63EG3QzDXoeOK hOVkpt1FmINFiXdXlRqyycLDGrSmZwBqAJl/Rxizkn64PSbmdKArXfj1QW92wSVRigfU hVq5PZvUKLwxN4axIZQbGsoQDm5FV1a1e+tn1RxCDaMkPhqr7kNWYZPTNqpDS9e4ZcvE cg/Z6cuOjseMLntwWlu4MLqvxi8I098HZhxiFptt4WQ35FI7wLJikuPNCNbtgtXGNXkC xYLA== X-Forwarded-Encrypted: i=1; AJvYcCX5UDkuUa3mK6imIpcc+q08iVcCgPYIxuJ6ZlMh6uJnPwi1G2gIlT/t01sjbJyZpLI1Y94k+Zn1+xrZBiJRr+ei/lBywkQvWougDgMv X-Gm-Message-State: AOJu0YxITTiFIxQmo3G9Fs+XnJLTjp5v5ovnYAdkYeC3XXAbmW7cVMLg h/FOpQz0x4YIy9B2biE62Y2S8bnFQxDZ1LbA07LS4JEwQTbTytWxEEZgz9LdSpBXpLfr7gf6B1H jLCqihqoT2IMJfEo/uFs6He9ek68= X-Google-Smtp-Source: AGHT+IHCVxqWCq4pbmdbR2rZvAh3Erbrli0kYA6RSB76PonzTiaTzv788hOtuIwA5cN1d00zlVTHZFeMJRnHlrojz3s= X-Received: by 2002:a2e:a985:0:b0:2ef:dd45:8755 with SMTP id 38308e7fff4ca-2f3e9f72899mr7124531fa.9.1724134200848; Mon, 19 Aug 2024 23:10:00 -0700 (PDT) MIME-Version: 1.0 References: <20230828115252.c1b018605b9a0756a30c3382@sraoss.co.jp> <20230828160530.adde1e20f257d7d345989163@sraoss.co.jp> <20230902.204634.955758704959569058.t-ishii@sranhm.sra.co.jp> <20240123162327.c2803162619dd7634cca0b6c@sraoss.co.jp> <20240304115846.2275fb44fd904e8789d43590@sraoss.co.jp> <20240329234700.73ff2e28c9248d29f8fa6a66@sraoss.co.jp> <20240331225931.712683cecb26862b73b2b822@sraoss.co.jp> <20240702170311.1ddb417759a48ff12c555b92@sranhm.sraoss.co.jp.sranhm> <20240711132357.fe3f78c184cfa99159208178@sranhm.sraoss.co.jp> <20240730142420.34a9ad7c249aecde88cd45fb@sraoss.co.jp> In-Reply-To: From: Kirill Reshke Date: Tue, 20 Aug 2024 11:09:49 +0500 Message-ID: Subject: Re: Incremental View Maintenance, take 2 To: Yugo NAGATA Cc: Peter Smith , jian he , Tatsuo Ishii , pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 20 Aug 2024 at 02:14, Kirill Reshke wrote: > == Other thoughts > > In OLAP databases (see [2]), IVM opens the door for 'view > exploitation' feature. That is, use IVM (which is always up-to-date) > for query execution. But current IVM implementation is not compatible > with Cloudberry Append-optimized Table Access Method. The problem is > the 'table_tuple_fetch_row_version' call, which is used by > ivm_visible_in_prestate to check tuple visibility within a snapshot. I > am trying to solve this somehow. My current idea is the following: > multiple base table modification via single statement along with tuple > deletion from base tables are features. We can error-out these cases > (at M.V. creation time) all for some TAMs, and support only insert & > truncate. However, I don't know how to check if TAM supports > 'tuple_fetch_row_version' other than calling it and receiving > ERROR[3]. > I reread this and I find this a little bit unclear. What I'm proposing here is specifying the type of operations IVM supports on creation time. So, one can run CREATE IVM immv1 WITH (support_deletion = true/false, support_multiple_relation_change = true/false). Then, in the query execution time, we just ERROR if the query leads to deletion from IVM and support_deletion if false. -- Best regards, Kirill Reshke