Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8TXd-0002Iv-OR for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jul 2022 21:23:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o8TWe-0006LX-DK for pgsql-hackers@arkaria.postgresql.org; Mon, 04 Jul 2022 21:22:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o8TWd-0006LN-V4 for pgsql-hackers@lists.postgresql.org; Mon, 04 Jul 2022 21:22:36 +0000 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o8TWZ-0002Sc-Pp for pgsql-hackers@lists.postgresql.org; Mon, 04 Jul 2022 21:22:35 +0000 Received: by mail-qk1-x72f.google.com with SMTP id z16so7484043qkj.7 for ; Mon, 04 Jul 2022 14:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=L/bUpqOyAokjpiAvXSolk1zlYnN46coUM3mQkEp8EEs=; b=pDuLpgS/bKipVItRVCzhAiiwe7XCz1+5NywY7mgAwZwljGAF7scSHfcOZiKB+mhvZJ BNLSnL8nkXcpIBp2RpZW6dVNu0Rhv/zh1JB94REtcHLjR8V37KsFHxurVWajdOQhZmN7 jhb+jyVMzoAb3rgbpGmx8LbY1/f8VGvqES8NC6z67FGpxywJdf6pJAGN+XOvTj+0ymBt 3ZDjbXjEdX5p1uYT+NHkMTG9pa5RWpyTwV5WORt8pfsmjZnN8XUCtMEgTgpi3JzvfZRn QBuRsDAc0jT5HfQ6wUMTmtwf9bIT7T7ggeib94n76ZV41509JywhA2Tw7xP9BoTKymkt UQ5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=L/bUpqOyAokjpiAvXSolk1zlYnN46coUM3mQkEp8EEs=; b=C9AY2cbg4MjC676NbXP8623zPGV9eRRAf6+EeYw3LRTsf9SWahI2aA66G11QSn7RxI UT6Mv4nbkFf6pzVVQlzD6/+B8NeKiMfgsFlL9qYBvVjVqEbv8TO/QtVj2DVVRFj/4nrq y3FoGxZ/Ji3HRm8zSYqYGIM3fXpDt+Lz38MjF9hDVFKnasWIAPrdIFEM7+1uemCDTRHm PA2pNFOLhKVRHbwdZ4H5bYy325OFcBRdKjrB7hnRHQj8C8yu1KMa63FeqNaDJCfKOJpC lLBh4ODIcTeUNMM3+w0xI+/LDv6HY0yClKouPNqHfkafVXH2/HCiSZcJR1Lfstbig1Ws Ej5g== X-Gm-Message-State: AJIora9Bu3eahuUEfFVeAQp/J9LTHjK3m5EGhW7MYcCBm0VcCN4RJ785 KFXVnJhfcDQ9rCvA9MzCNKfHCg== X-Google-Smtp-Source: AGRyM1vytVtEd8a+3ySxXu3o9x83LQOHniMYmUF1NXPCTXA9BFIaABS20H09vuJ5RAwZ6SLLSHQv7w== X-Received: by 2002:a05:620a:469e:b0:6b0:e66a:6bd with SMTP id bq30-20020a05620a469e00b006b0e66a06bdmr20253967qkb.285.1656969749575; Mon, 04 Jul 2022 14:22:29 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id bt5-20020ac86905000000b0031bf68f502esm12245304qtb.59.2022.07.04.14.22.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2022 14:22:29 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 25C73800785; Mon, 4 Jul 2022 16:22:28 -0500 (CDT) Date: Mon, 4 Jul 2022 16:22:28 -0500 From: Justin Pryzby To: Alvaro Herrera Cc: Roberto Mello , pgsql-hackers@lists.postgresql.org, Jaime Casanova Subject: Re: doc: BRIN indexes and autosummarize Message-ID: <20220704212227.GN13040@telsasoft.com> References: <20220704152011.4rypgtgfu66rktkq@alvherre.pgsql> <20220704193842.b3etivkx3vxqbpwm@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="RpqchZ26BWispMcB" Content-Disposition: inline In-Reply-To: <20220704193842.b3etivkx3vxqbpwm@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --RpqchZ26BWispMcB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jul 04, 2022 at 09:38:42PM +0200, Alvaro Herrera wrote: > + There are several triggers for initial summarization of a page range > + to occur. If the table is vacuumed, either because > + has been manually invoked or because > + autovacuum causes it, > + all existing unsummarized page ranges are summarized. I'd say "If the table is vacuumed manually or by autovacuum, ..." (Or "either manually or by autovacuum, ...") > + Also, if the index has the > + parameter set to on, Maybe say "If the autovacuum parameter is enabled" (this may avoid needing to revise it later if we change the default). > + then any run of autovacuum in the database will summarize all I'd avoid saying "run" and instead say "then anytime autovacuum runs in that database, all ..." > + unsummarized page ranges that have been completely filled recently, > + regardless of whether the table is processed by autovacuum for other > + reasons; see below. say "whether the table itself" and remove "for other reasons" ? > > When autosummarization is enabled, each time a page range is filled a Maybe: filled comma > - request is sent to autovacuum for it to execute a targeted summarization > - for that range, to be fulfilled at the end of the next worker run on the > - same database. If the request queue is full, the request is not recorded > - and a message is sent to the server log: > + request is sent to autovacuum for it to execute a targeted > + summarization for that range, to be fulfilled at the end of the next > + autovacuum worker run on the same database. If the request queue is full, the "to be fulfilled the next time an autovacuum worker finishes running in that database." or "to be fulfilled by an autovacuum worker the next it finishes running in that database." > +++ b/doc/src/sgml/ref/create_index.sgml > @@ -580,6 +580,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] > Defines whether a summarization run is invoked for the previous page > range whenever an insertion is detected on the next one. > + See for more details. > + The default is off. Maybe "invoked" should say "queued" ? Also, a reminder that this was never addressed (I wish the project had a way to keep track of known issues). https://www.postgresql.org/message-id/20201113160007.GQ30691@telsasoft.com |error_severity of brin work item |left | could not open relation with OID 292103095 |left | processing work entry for relation "ts.child.alarms_202010_alarm_clear_time_idx" |Those happen following a REINDEX job on that index. This inline patch includes my changes as well as yours. And the attached patch is my changes only. diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml index caf1ea4cef1..90897a4af07 100644 --- a/doc/src/sgml/brin.sgml +++ b/doc/src/sgml/brin.sgml @@ -73,31 +73,55 @@ summarized range, that range does not automatically acquire a summary tuple; those tuples remain unsummarized until a summarization run is invoked later, creating initial summaries. - This process can be invoked manually using the - brin_summarize_range(regclass, bigint) or - brin_summarize_new_values(regclass) functions; - automatically when VACUUM processes the table; - or by automatic summarization executed by autovacuum, as insertions - occur. (This last trigger is disabled by default and can be enabled - with the autosummarize parameter.) - Conversely, a range can be de-summarized using the - brin_desummarize_range(regclass, bigint) function, - which is useful when the index tuple is no longer a very good - representation because the existing values have changed. - When autosummarization is enabled, each time a page range is filled a - request is sent to autovacuum for it to execute a targeted summarization - for that range, to be fulfilled at the end of the next worker run on the - same database. If the request queue is full, the request is not recorded - and a message is sent to the server log: + There are several ways to trigger the initial summarization of a page range. + If the table is vacuumed, either manually or by + autovacuum, + all existing unsummarized page ranges are summarized. + Also, if the index's + parameter is enabled, + whenever autovacuum runs in that database, summarization will + occur for all + unsummarized page ranges that have been filled, + regardless of whether the table itself is processed by autovacuum; see below. + + Lastly, the following functions can be used: + + + + brin_summarize_range(regclass, bigint) + summarizes all unsummarized ranges + + + brin_summarize_new_values(regclass) + summarizes one specific range, if it is unsummarized + + + + + + When autosummarization is enabled, each time a page range is filled, a + request is sent to autovacuum to execute a targeted + summarization for that range, to be fulfilled the next time an autovacuum + worker finishes running in that database. If the request queue is full, the + request is not recorded and a message is sent to the server log: LOG: request for BRIN range summarization for index "brin_wi_idx" page 128 was not recorded When this happens, the range will be summarized normally during the next regular vacuum of the table. + + + Conversely, a range can be de-summarized using the + brin_desummarize_range(regclass, bigint) function, + which is useful when the index tuple is no longer a very good + representation because the existing values have changed. + See for details. + + diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index 9ffcdc629e6..a5bac9f7373 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -578,8 +578,10 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] - Defines whether a summarization run is invoked for the previous page + Defines whether a summarization run is queued for the previous page range whenever an insertion is detected on the next one. + See for more details. + The default is off. --RpqchZ26BWispMcB Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-f.txt" From 28e8e2106983fc05e9415b078bcf6b158b49337e Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Mon, 4 Jul 2022 16:11:40 -0500 Subject: [PATCH] f --- doc/src/sgml/brin.sgml | 28 ++++++++++++++-------------- doc/src/sgml/ref/create_index.sgml | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml index 0a715d41c71..90897a4af07 100644 --- a/doc/src/sgml/brin.sgml +++ b/doc/src/sgml/brin.sgml @@ -76,17 +76,17 @@ - There are several triggers for initial summarization of a page range - to occur. If the table is vacuumed, either because - has been manually invoked or because - autovacuum causes it, + There are several ways to trigger the initial summarization of a page range. + If the table is vacuumed, either manually or by + autovacuum, all existing unsummarized page ranges are summarized. - Also, if the index has the - parameter set to on, - then any run of autovacuum in the database will summarize all - unsummarized page ranges that have been completely filled recently, - regardless of whether the table is processed by autovacuum for other - reasons; see below. + Also, if the index's + parameter is enabled, + whenever autovacuum runs in that database, summarization will + occur for all + unsummarized page ranges that have been filled, + regardless of whether the table itself is processed by autovacuum; see below. + Lastly, the following functions can be used: @@ -102,10 +102,10 @@ - When autosummarization is enabled, each time a page range is filled a - request is sent to autovacuum for it to execute a targeted - summarization for that range, to be fulfilled at the end of the next - autovacuum worker run on the same database. If the request queue is full, the + When autosummarization is enabled, each time a page range is filled, a + request is sent to autovacuum to execute a targeted + summarization for that range, to be fulfilled the next time an autovacuum + worker finishes running in that database. If the request queue is full, the request is not recorded and a message is sent to the server log: LOG: request for BRIN range summarization for index "brin_wi_idx" page 128 was not recorded diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index d3db03278d6..a5bac9f7373 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -578,7 +578,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] - Defines whether a summarization run is invoked for the previous page + Defines whether a summarization run is queued for the previous page range whenever an insertion is detected on the next one. See for more details. The default is off. -- 2.17.1 --RpqchZ26BWispMcB--