From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Gayathri TK <gtambar(at)ncsu(dot)edu> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Having trouble startin off with the code.. |
Date: | 2005-10-27 09:07:38 |
Message-ID: | 20051027090737.GB4259@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Oct 27, 2005 at 12:04:11AM -0400, Gayathri TK wrote:
> Hi all,
>
> I am new user of postgres.. I am currently working on a project
> for my advisor and the project is to implement an algorithm for
> materialiazed view design as explained in this paper
> [http://www.vldb.org/conf/1997/P136.PDF - MVPP Generation part and sec
> 4.1 for selecting views as such.. ]
<snip>
> As i understand from the paper, the only reason i am using postgres is
> to be able to get ALL POSSIBLE JOIN PLANS from optimizer.. other than
> this my algorithm is self sufficient.. Hence i would like to know what
> is the best way to go about implementing the algorithm.. Here are my
> thougths..
>
> 1. I can implement it as a "command" in postgres... I donno the exact
> steps for this, but understand that it requires modifying a LOT of files ..
>
> 2. I can write my own standalone code, if i could invoke postgres with
> my query from the code and be able to access optimizer to get list of
> all possible join plans ? is it possible to do this? How do i invoke
> postgres from C code?
Just a hint, by *far* the easier method is to write it as a standalone
module first, like myfunc(string). The reason is that a function is
loaded seperately you during development. You change the code, compile,
test, etc...
If you build it into the main system you have to change a lot more code
(you noticed that) and you have to recompile everything just to test.
Once you've got your external function doing what you want, you can
start looking to integrate the parser and other node.
> I would also like to know your rough guess on the time i would take to
> do the interfacing with postgres? [ i am above average C programmer..
> pretty good in pointers.. but this is my first exposure to open source
> database..]
The code you're looking for is probably in src/backend/optimizer/path
or plan. *Read* the README files scattered around the directories, they
explain a lot. Also, following the execution path through the different
modules is clarifying. There are lot of comments explaining what's
going on. You won't understand them the first time round, but give it
time...
Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2005-10-27 09:16:19 | Re: ERROR: invalid memory alloc request size <a_big_number_here> |
Previous Message | Matteo Beccati | 2005-10-27 08:59:30 | ERROR: invalid memory alloc request size <a_big_number_here> |