Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtx5b-0000VT-0a for pgsql-performance@arkaria.postgresql.org; Mon, 18 Sep 2017 14:31:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dtx5a-0005zr-Dq for pgsql-performance@arkaria.postgresql.org; Mon, 18 Sep 2017 14:31:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dtx5Z-0005yQ-2O for pgsql-performance@postgresql.org; Mon, 18 Sep 2017 14:31:57 +0000 Received: from mail-yw0-x235.google.com ([2607:f8b0:4002:c05::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dtx5R-0003a2-IU for pgsql-performance@postgresql.org; Mon, 18 Sep 2017 14:31:55 +0000 Received: by mail-yw0-x235.google.com with SMTP id u205so362ywa.5 for ; Mon, 18 Sep 2017 07:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=v5qm70Bgdr3M7/7Aq3tbggk6tzgKvQGu8nh36q+SZPA=; b=PQcY3fH9hCC91RBc7B3yYdILFsBrmv8Acd1uUU/j4mUVFkjzSeT6iEM6TqQ8qLUY6e o68GfsGRx6/Pz9eMsiMnNQMn7+cSk18g1ZoR3yv9Hl0HryHt+2RsBTW15PH23v+REhcM zJErGsZNaiHUdKl9wFCN4DqW6whuDVK/Wm6Lu/xwDujzhYrqDnHt9PEsEbsTBwjVUoI+ /dZMDN1q0TfBdd85BAK4BMp1ci2we/eWPpwqOQjyi1ZMFjDZnRN7WUzUr9lPLyF1/DFK i6RyJmzUMmencAF9TFlxLc2QKqA4xf9Oo3cRiboCHyklvKGGwz/zNOL9oWVb9VlWj1WC cfLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=v5qm70Bgdr3M7/7Aq3tbggk6tzgKvQGu8nh36q+SZPA=; b=cP29lM0mTZbJ660pdk+qX65qCzjEkHnvsJBa0R89xvmjIvKL1n+h6MxOtr7WS4vobD bu7wfuPuVu86FTtiRdv66oGIpULQ6WyjONLQW/cOv9xhls/HdXmGqqszcD7WED+FKn50 D6zdnvojtxw3+guxseJNylG2wH4keDGrkq8Z59Wo0A/5K08fxCSwyZaaSDub3nUAj77w CHgzTBdVWgLv60MlfAJTVEatEXxjgXv0v+27SMhyviDC1KmrVB6hd8qtxCvWe5YDMYNl CADXynL4xpkGOhzP82eoNOZAW8NRqkKpxuKcVMVEjlYlHnhbGIV7n4juiwNoRzrny4QG r6sw== X-Gm-Message-State: AHPjjUj16Q4S8HeUnxv2ixmS1wJQN3tzAR/AVOevCSJC/JjmNrqiqr1m HN4v6WLqGDNK5E4tBAngNbf7ZRR7xpYlnCmp+vWcYQ== X-Google-Smtp-Source: AOwi7QA4jcXV7L8NVaortsYvbp7Ju2lGPn25MtfIKcQEq4zzWffSNVCj1uSTYBqeIKn/soGC1pvELzia+uL7xM8gmBE= X-Received: by 10.37.45.108 with SMTP id s44mr22552603ybe.226.1505745108009; Mon, 18 Sep 2017 07:31:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.182.1 with HTTP; Mon, 18 Sep 2017 07:31:47 -0700 (PDT) In-Reply-To: References: From: Neto pr Date: Mon, 18 Sep 2017 11:31:47 -0300 Message-ID: Subject: Re: Pageinspect bt_metap help To: Peter Geoghegan Cc: postgres performance list Content-Type: multipart/alternative; boundary="f4030435b2304908590559779aa7" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org --f4030435b2304908590559779aa7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Very interesting information. See if I'm right, so for performance purposes, would it be better to consider the columns: fast_root and fast_level instead of the root and level columns? I have read that even deleting records the B-tree tree is not rebuilt, so it does not cause overhead in dbms, and can have null pointers. In my example, the values =E2=80=8B=E2=80=8Bof fast_root, fast_root are equ= al to root, level, I believe that due to the newly created index and no delete operations occurred in the table. Best Regards Neto 2017-09-17 18:59 GMT-03:00 Peter Geoghegan : > On Sun, Sep 17, 2017 at 2:52 PM, Neto pr wrote: > > I am using Postgresql extension pageinspect. > > > > Could someone tell me the meaning of these columns: magic, version, roo= t, > > level, fastroot, fastlevel of the bt_metap function. > > > > This information is not presents in the documentation. > > A magic number distinguishes the meta-page as a B-Tree meta-page. A > version number is used for each major incompatible revision of the > B-Tree code (these are very infrequent). > > The fast root can differ from the true root following a deletion > pattern that leaves a "skinny index". The implementation can never > remove a level, essentially because it's optimized for concurrency, > though it can have a fast root, to just skip levels. This happens to > levels that no longer contain any distinguishing information in their > single internal page. > > I imagine that in practice the large majority of B-Trees never have a > true root that differs from its fast root - you see this with repeated > large range deletions. Probably nothing to worry about. > > > The height of the b-tree (position of node farthest from root to leaf), > is > > the column Level? > > Yes. > > If you want to learn more about the B-Tree code, I suggest that you > start by looking at the code for contrib/amcheck. > > -- > Peter Geoghegan > --f4030435b2304908590559779aa7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Very interesting information.
See if I'= m right, so for performance purposes, would it be better to consider the co= lumns: fast_root and fast_level instead of the root and level columns?

I have read that even deleting records the B-tree tree= is not rebuilt, so it does not cause overhead in dbms, and can have null p= ointers.

In my example, the values =E2=80=8B=E2=80= =8Bof fast_root, fast_root are equal to root, level, I believe that due to = the newly created index and no delete operations occurred in the table.

Best Regards=C2=A0
Neto

2017-09-17 18:59 GMT-03:0= 0 Peter Geoghegan <pg@bowt.ie>:
<= span class=3D"">On Sun, Sep 17, 2017 at 2:52 PM, Neto pr <netopr9@gmail.com> wrote:
> I am using Postgresql extension pageinspect.
>
> Could someone tell me the meaning of these columns: magic, version, ro= ot,
> level, fastroot, fastlevel of the bt_metap function.
>
> This information is not presents in the documentation.

A magic number distinguishes the meta-page as a B-Tree meta-page. A<= br> version number is used for each major incompatible revision of the
B-Tree code (these are very infrequent).

The fast root can differ from the true root following a deletion
pattern that leaves a "skinny index". The implementation can neve= r
remove a level, essentially because it's optimized for concurrency,
though it can have a fast root, to just skip levels. This happens to
levels that no longer contain any distinguishing information in their
single internal page.

I imagine that in practice the large majority of B-Trees never have a
true root that differs from its fast root - you see this with repeated
large range deletions. Probably nothing to worry about.

> The height of the b-tree (position of node farthest from root to leaf)= , is
> the column Level?

Yes.

If you want to learn more about the B-Tree code, I suggest that you
start by looking at the code for contrib/amcheck.

--
Peter Geoghegan

--f4030435b2304908590559779aa7--