SPI access to PostgreSQL query plan

Поиск
Список
Период
Сортировка
От Cristiano Duarte
Тема SPI access to PostgreSQL query plan
Дата
Msg-id 36bc054c0709170654g575d7fb9tbc2f53b1e4c2384@mail.gmail.com
обсуждение исходный текст
Ответы Re: SPI access to PostgreSQL query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
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 /> 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Fix up text concatenation so that it accepts all the reasonable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: SPI access to PostgreSQL query plan