Sophie,
You, my dear, are not a novice. Get off this list! <grin>
> >From the big picture of PostgreSQL architecture, I
> understand that query processing includes parser,
> rewriter, optimizer and executor. I am wondering at
> which step, PostgreSQL performs algebraic rewriting?
> What rules are used for rewriting? Are these rules
> hard wired or are they stored in some catalog table?
> If I want to check the source codes, which file should
> I look at?
Check out http://developer.postgresql.org/index.php
And then join the pgsql-hackers mailing list.
-Josh Berkus