Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dthbc-0007f2-JT for pgsql-performance@arkaria.postgresql.org; Sun, 17 Sep 2017 22:00:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dthbc-00080c-4X for pgsql-performance@arkaria.postgresql.org; Sun, 17 Sep 2017 22:00:00 +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 1dthbb-00080T-Jr for pgsql-performance@postgresql.org; Sun, 17 Sep 2017 21:59:59 +0000 Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dthbY-0007yK-Rp for pgsql-performance@postgresql.org; Sun, 17 Sep 2017 21:59:58 +0000 Received: by mail-it0-x236.google.com with SMTP id l136so2325182ita.0 for ; Sun, 17 Sep 2017 14:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bowt-ie.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5tmiOvNYh4FloqdBjSfH7OZjjJApKSaxRqclxmU8HY4=; b=ayGLpzTO4veMWBIGFw5nilr7fIfGwelFXn5ldqC3mlGDp06m4kup2KXgWgAUw/yfBo sMrODjazGcH1+0Hy1fZFex5oiEmzsRlitA9OtkqgTa/NDv6wvSn5ly1w1jh/FWOL95Dm G72JJJYNCm/LxnqqdJTjPPTXua6Ft69XOupwaCo4cTVwmo9VlCZf3jYSL2R5mIA3wH78 NE7tmYgV7ig9jY3/1V7WbKUfvqjHp2EwBa9AFaCZhPQSc3DEp2TJqoq0I1lc2ga7GhR6 oVxyMwJ/6JWTWS+YWnLBiCjFzdselugpyVODEc7XCN6ZEzWyVeN10/nXwyMnr4vFtm7Y Ln9Q== 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=5tmiOvNYh4FloqdBjSfH7OZjjJApKSaxRqclxmU8HY4=; b=M5U6TzZvtOmpF0RXob5yopb2R4ESaX3owL/qpybZztBk4tJY9Fa3BMmSIQj36yE/+/ gSSYIqK4KE1GdgFij3fCtYn458Mn1hTGe8aKRm08+naiu3zCAIou145nx2JTXb77F8KH xumfEgt4obtkj3kVWBPoUKqyEwXpyglAZqVWcbvw+7OAYtzktQB4aGDAjxA0Jgk9DbHr cptDQ+SwEReJ4877oXg9G4l0l6RAndpjy3SuBG/rnueSQg4iFRoOvQeT/RsVo3eauhtw pde7HrKxFIYhn7JM19KWujc5ILv/eqATUsUnYIi0gYQ/2N4Cmcf4NbibsY0pPQUwykNR 3kwg== X-Gm-Message-State: AHPjjUgJB5FllBKcR8JYTUpFmpwA1IvwB/SI/U7T0LDA+S1VtPb/aBGl E0oGq8p+3RNg+bnV1uB1LtatoDNyPX8qzCmpkimRww== X-Google-Smtp-Source: AOwi7QCOFpsSrPJWDypYyAJG/FcvrSWixcBjTdalqBV+X+PLL6oKMJnOdNQvfqbucO6yiWuby65fIDYk4lVJ8xpqHec= X-Received: by 10.36.69.91 with SMTP id y88mr12978855ita.99.1505685595175; Sun, 17 Sep 2017 14:59:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.2.154.228 with HTTP; Sun, 17 Sep 2017 14:59:34 -0700 (PDT) In-Reply-To: References: From: Peter Geoghegan Date: Sun, 17 Sep 2017 14:59:34 -0700 Message-ID: Subject: Re: Pageinspect bt_metap help To: Neto pr Cc: postgres performance list Content-Type: text/plain; charset="UTF-8" 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 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, root, > 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 -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance