where clause + function, execution order

Поиск
Список
Период
Сортировка
От Sorin Dudui
Тема where clause + function, execution order
Дата
Msg-id 13DE38ECCB7CE74890E7150A7CCB610D3642DD47@exc1.wigeo.lan
обсуждение исходный текст
Ответы Re: where clause + function, execution order  (Julius Tuskenis <julius@nsoft.lt>)
Re: where clause + function, execution order  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance

Hi,

 

I have the following function:

 

===============================

CREATE OR REPLACE FUNCTION xxx(text)

  RETURNS SETOF vvvvv AS

$BODY$

select a.x, a.y,

    CASE

    WHEN strpos($1,b.x) > 0

    THEN b.x

    ELSE NULL

    END AS mp_hm

from  a LEFT JOIN  b ON a.id=b.id

 

                $BODY$

  LANGUAGE sql STABLE

  COST 1000

  ROWS 10000;

===============================

 

which I call as:

 

select * from xxx(‘test0|test1‘)  where a.x = ‘value’

 

 

I am wondering when the where clause (a.x = ‘value’) is executed. After the select statement in the function finishes? Or is it appended at the select statement in the function?

 

 

Thank you,

Sorin

 

 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: avoiding seq scans when two columns are very correlated
Следующее
От: Julius Tuskenis
Дата:
Сообщение: Re: where clause + function, execution order