Some questions about PostgreSQL source code - Mailing list pgsql-hackers

From Олег Царев
Subject Some questions about PostgreSQL source code
Date
Msg-id 54f48e4f0905060754t2c18e6b3vf437416e4716c2eb@mail.gmail.com
Whole thread Raw
Responses Re: Some questions about PostgreSQL source code  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Some questions about PostgreSQL source code  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
<div style="text-align: left;">Hello all!<br />I need help in study internal structures of PosrgreSQL. Sorry for my bad
english.<br/>I try to get information from source code and spend five days for that, but now have many questions and
fewunderstanding =(<br /> Source code it's clear, great commented, but studing so difficult system as DBMS it's very
strongonly from source code.<br /></div><br />How to PostgreSQL process query?<br />I found some description on <a
href="http://anoncvs.postgresql.org/cvsweb.cgi/%7Echeckout%7E/pgsql/src/tools/backend/index.html"
target="_blank">http://anoncvs.postgresql.org/cvsweb.cgi/~checkout~/pgsql/src/tools/backend/index.html</a><br/>
Nevethelessi have questions.<br /><br />Parser translate from text of query to AST. <br /><br />1) Than AST go to
plannerfor plan normalization and optimization.<br />Planner work on AST structures, or build self internal tree of
logicalplan?<br /><br />2) Who set types of any columns? Parser or planner?<br /><br />After planner, called physical
plan- executor.<br /><br />1) Where in source build executor's node from logical plan (result of planner)?<br /><br
/>2)How to executor's node bulding, linked, and use one another? For example how to linked Table Scan and Sort on query
selecta,b,c,d from table order by a,b? Let's assume query work without indexes, for simple describing.<br /><br />3)
Whatthe function called on Prepare/Execute? How this calls translated to executor's nodes?<br /><br />I try look for 
thisinformation in source code, and found execAim.c, with big swtich.<br />In that switch mixed brachnes of nodes, node
states,some expressions and aggregation.<br /> What is mind that switch in execAim.c? How to Prepare/Execute/Fetch work
withexecutor's nodes?<br /><br />4) How to manipulate data on the nodes? I understand from comments, what every node
useown childs for get "tuple", where "tuple" - list of "cells". I didn't found "cells" in source code =(<br /> Can you
descrivbeme, how to one node get data from source node, return data for parent, and what is "data" and where i can
foundin source code this entity?<br /><br />For start, this questions it's very important for me.<br /> Thank you.<br
/>

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: text_pattern_ops and complex regexps
Next
From: Tom Lane
Date:
Subject: Re: text_pattern_ops and complex regexps