How to modify parser in PostgreSQL to handle new keyword and parse it - Mailing list pgsql-general

From Rajmohan C
Subject How to modify parser in PostgreSQL to handle new keyword and parse it
Date
Msg-id CAHaqV0gZ_C9iqsHaDfQQxc2HxwaeYWjCesFVHK1-AMJA9xkMKg@mail.gmail.com
Whole thread Raw
List pgsql-general
I am working on implementing Selectivity hints feature in PostgreSQL 9.3.4. I am working on this only for using it in my academic research. I have decided to give selectivity information per relation as part of query like shown below.

select * from lineitem, orders where l_extendedprice <=2400 and l_orderkey = o_orderkey selectivity(lineitem, 0.3) selectivity(orders, 0.7);

I tried separating the selectivity hint portion of the query before Postgres parses query. But it becomes very clumsy. I am thinking Postgres parser modification to handle this case could be complex that is why I did not get into Postgres grammar and parser. How should I take this selectivity hints separate from a normal query and populate in my data structures?

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: is there a way log last query in pg_stat_activity
Next
From: Bill Mitchell
Date:
Subject: Re: Best practices for cloning DB servers