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 1ibosX-0007PF-60 for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2019 16:48:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ibosV-0000Ur-QF for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Dec 2019 16:48:51 +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 1ibosV-0000Uk-Gq for pgsql-hackers@lists.postgresql.org; Mon, 02 Dec 2019 16:48:51 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ibosR-0002Q2-Uk for pgsql-hackers@postgresql.org; Mon, 02 Dec 2019 16:48:50 +0000 Received: by mail-qt1-x842.google.com with SMTP id p5so315131qtq.12 for ; Mon, 02 Dec 2019 08:48:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=sOnfz+OlM+NbtPlqDGdK9tehk8OcxxeTCPlQlfF8wXI=; b=R2D6dJJtQdP8H9svpwIXQ35WLuicVcgFB/d1rDzoWmC+1Y3KZ1NzO6NVPNe/TWI8GB 1/8x1cf8gU14nUY+H/JEITG8ugIhdSaE7ctgP9tqF27zwUs1UmpjgTjRV1T3RXhOKJwS Gtjkjm6uJbmdVejunI/ffgAgQchiiESQElMEm84KvxCSi/Ir50WVHP6YhcHHMxRs5eGC WtlKcImDD4cs/KT8TLEyo7NyuWdZAbYXuEh97S8/VHfjr6iI+dpktnIr6h2CX4fcjoea S/Ix4C+S40SdHWrz23DOMdOx3QU3bHSbz4Qk+T9mGqsSsJilA1qQ8E/p2siG/aYBIT7i Ljwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sOnfz+OlM+NbtPlqDGdK9tehk8OcxxeTCPlQlfF8wXI=; b=SoooPE28Du3IfUp276AK5KTATCRH9ym7D2NHDPFoH5jj/aVA5Z1Bq38rhROsucXwA6 J8alxXU9V/gIiQ5NM4tO2cyfeRJ2WjDQBG4Wz67UJieq0DHE8MWnBeBQ8oT7QG8OVeCs xsbeMwmmLzsUpmgdMM3BwNREoeqGJt0/P0YMbEJPmy90N/xTvBd3+BTFmgCyGGHCnPRh MP1VqBc+1YFlREAwzY5LSorYfuvS6KgU5J5eWDk4TX0q2S6YRjFFz5nhyOJdxaeKvrpk 1pUBryLwT9ATQI16loj7oIZbk8J9TbuB4d7FOe/WKD1KS9jn/Eio4/LX9989I44hjVhJ VdVw== X-Gm-Message-State: APjAAAV9WSww1EhqLymksbYaUSTp9irqfIANN3SIExiKoV+dRIMRWfn1 G5a/SALt261r+qWhp0Omwt5uaA== X-Google-Smtp-Source: APXvYqxzZ8xYsxjDDfOjoOpS+QN79A1IuDzKdyMnDTu5Yp5et+fyUUUk53NTJaM9QJzYOvFXo9SoRg== X-Received: by 2002:ac8:6a11:: with SMTP id t17mr223218qtr.284.1575305324860; Mon, 02 Dec 2019 08:48:44 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id x65sm44200qkd.15.2019.12.02.08.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2019 08:48:44 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 7413F3006B0; Mon, 2 Dec 2019 13:48:40 -0300 (-03) Date: Mon, 2 Dec 2019 13:48:40 -0300 From: Alvaro Herrera To: Yugo Nagata Cc: Tatsuo Ishii , pgsql-hackers@postgresql.org, hoshiai@sraoss.co.jp, thomas.munro@gmail.com, kgrittn@gmail.com Subject: Re: Implementing Incremental View Maintenance Message-ID: <20191202164840.GA8271@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191202154208.b613271eff61bc34b570d009@sraoss.co.jp> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Dec-02, Yugo Nagata wrote: > On Mon, 02 Dec 2019 10:36:36 +0900 (JST) > Tatsuo Ishii wrote: > > > >> One thing pending in this development line is how to catalogue aggregate > > >> functions that can be used in incrementally-maintainable views. > > >> I saw a brief mention somewhere that the devels knew it needed to be > > >> done, but I don't see in the thread that they got around to doing it. > > >> Did you guys have any thoughts on how it can be represented in catalogs? > > >> It seems sine-qua-non ... > > > In the first option, we support only built-in aggregates which we know able > > > to handle correctly. Supported aggregates can be identified using their OIDs. > > > User-defined aggregates are not supported. I think this is the simplest and > > > easiest way. > > > > I think this is enough for the first cut of IVM. So +1. > > If there is no objection, I will add the check of aggregate functions > by this way. Thanks. The way I imagine things is that there's (one or more) new column in pg_aggregate that links to the operator(s) (or function(s)?) that support incremental update of the MV for that aggregate function. Is that what you're proposing? All that query-construction business in apply_delta() looks quite suspicious. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services