Re: B tree index || function information

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Rohit Goyal <rhtgyl(dot)87(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: B tree index || function information
Date: 2013-11-20 04:49:27
Message-ID: CA+HiwqHDiUT9iFzPLR=949jiWaA6q19xPSSMGBfNjnrYV6bUPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

On Tue, Nov 19, 2013 at 5:53 PM, Rohit Goyal <rhtgyl(dot)87(at)gmail(dot)com> wrote:
> Hi All,
>
> If we have a table and btree index on it.
> I would like to know what specific files and functions are called to insert
> data into index whenever I want to insert data into a table.
>
> For example, if I insert a anew row into a table, then a new row in index
> will be inserted. I would like to know the sequential flow of functions or
> files called to insert data into a btree.
>
> Please give me the flow for both an empty btree or an existing btree with
> (key, value) pairs.
>

As suggested elsewhere, it would be really helpful if you could learn
to use gdb for command line debugging and at least one command line
source code navigation tool like cscope. There are many online
resources for that. That way, you can easily follow what people here
on the mailing list might ask you to do like set a breakpoint in a
particular function as a starting point. Otherwise, I think it's
difficult for most people to create a flowchart (with references to
functions and files in which they are listed) or something like that.
Since, it appears you want to make some changes to the code, I think
understanding what's already going on with the help of debugging would
really help.

To answer your specific question regarding empty and existing btree, I
guess you mean build a btree index by the first and insert a row into
a table with a btree index already present.

1) btbuild - builds a new btree index
2) btinsert - insert an index tuple into a btree (from a comment in
the source code - Descend the tree recursively, find the appropriate
location for our new tuple, and put it there)

--
Amit

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Amit Langote 2013-11-20 04:55:35 Re: B tree index || function information
Previous Message Merlin Moncure 2013-11-19 23:51:39 Re: Transaction Id and status of any operation