Hi,<br /><br />Is there a way to have access to PostgreSQL query plan and/or predicates inside a function using spi (or
anyother way)?<br />For example:<br /><br />explain select * from my_func() as (code int, name varchar) where name like
'a%';<br /> QUERY PLAN<br />--------------------------------------------------------------<br
/> FunctionScan on my_func (cost=0.00..15.00 rows=5 width=36)<br /> Filter: ((name)::text ~~ 'a%'::text) <br /><br
/>Iwould like to know, inside the my_func function that PostgreSQL will filter the function's returned result on the
namecolumn <br />with a like operator matching 'a%'. Since inside the my_func function I do another database query, I
could"pre-filter" this <br />query and reduce the amount of records returned.<br /><br />If the whole plan cannot be
exposedto spi, can only the part involved on filtering/manipulating the records returned from<br /> the function
call?<br/><br />Is the query plan saved in memory at a place where a spi function can have access? <br /><br
/>Regards,<br/><br />Cristiano Duarte.<br /><br />