Thread: Information about Access methods

Information about Access methods

From
Rohit Goyal
Date:
Hi, 

I am looking in Postgresql code for the first time. Specifically in Indexing scheme.


I want to focus on B tree for my testing. 

Inside access methods in Backend, I found "Index" folder and "Btree" folder but i don't know which code to look for. i want to change something in B tree implementation.

Please guide.

Regards,
Rohit Goyal

Re: Information about Access methods

From
Craig Ringer
Date:
On 11/12/2013 07:00 PM, Rohit Goyal wrote:
> 
> Inside access methods in Backend, I found "Index" folder and "Btree"
> folder but i don't know which code to look for. i want to change
> something in B tree implementation.
> 

Start here:

http://www.postgresql.org/docs/current/static/indexam.html

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



Re: Information about Access methods

From
Rohit Goyal
Date:
Hi, 
Thanks for document. It was really helpful. 
Now, as index folder contains basically interface for all index type, do I need to change it, if I want to modify only b tree index algorithm?

Do I need to change only btree index files or Do i have to change index folder files like indexam.c
Please confirm. :)

Regards,
Rohit


On Tue, Nov 12, 2013 at 1:22 PM, Craig Ringer <craig@2ndquadrant.com> wrote:
On 11/12/2013 07:00 PM, Rohit Goyal wrote:
>
> Inside access methods in Backend, I found "Index" folder and "Btree"
> folder but i don't know which code to look for. i want to change
> something in B tree implementation.
>

Start here:

http://www.postgresql.org/docs/current/static/indexam.html

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



--
Regards,
Rohit Goyal

Re: Information about Access methods

From
Craig Ringer
Date:
On 11/13/2013 06:36 AM, Rohit Goyal wrote:
> Hi, 
> Thanks for document. It was really helpful. 
> Now, as index folder contains basically interface for all index type, do
> I need to change it, if I want to modify only b tree index algorithm?
> 
> Do I need to change only btree index files or Do i have to change index
> folder files like indexam.c

Without knowing what you are trying to do, it's really hard to answer
that usefully. In general if you want to modify b-tree indexes you'd
only have to modify the b-tree index implementation. If you want to add
new capabilities or features to the indexing system in general then use
them in b-tree, you'd probably also have to modify the access method
interface.

If you aren't just doing this for learning/research you should explain
in detail what you are trying to do. There is no point spending lots of
time creating a patch that would never get accepted into the PostgreSQL
core, so you have to maintain it forever more...


-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



Re: Information about Access methods

From
Rohit Goyal
Date:
On Wed, Nov 13, 2013 at 2:42 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
On 11/13/2013 06:36 AM, Rohit Goyal wrote:
> Hi,
> Thanks for document. It was really helpful.
> Now, as index folder contains basically interface for all index type, do
> I need to change it, if I want to modify only b tree index algorithm?
>
> Do I need to change only btree index files or Do i have to change index
> folder files like indexam.c

Without knowing what you are trying to do, it's really hard to answer
that usefully. In general if you want to modify b-tree indexes you'd
only have to modify the b-tree index implementation. If you want to add
new capabilities or features to the indexing system in general then use
them in b-tree, you'd probably also have to modify the access method
interface.

If you aren't just doing this for learning/research you should explain
in detail what you are trying to do. There is no point spending lots of
time creating a patch that would never get accepted into the PostgreSQL
core, so you have to maintain it forever more...

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
Hi, 

Thanks for update. Actually, I am doing it for learning. I want to modify B tree approach for insert and update operation to perform in a more faster way.
Could you please suggest something about abt update operation of B tree index. 

Regards,
Rohit Goyal

Re: Information about Access methods

From
Antonin Houska
Date:
On 11/13/2013 08:59 AM, Rohit Goyal wrote:
> Could you please suggest something about abt update operation of B tree
> index.

access/nbtree/README is probably the next text to read. It points to
theoretical background and also explains specifics of Postgres
implementation.

// Antonin Houska (Tony)