avoid pulling up subquerys that contain volatile functions?

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема avoid pulling up subquerys that contain volatile functions?
Дата
Msg-id c2d9e70e0510080851h3396e2b3hd1b21f83fe6f281c@mail.gmail.com
обсуждение исходный текст
Ответы Re: avoid pulling up subquerys that contain volatile functions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
the comments fot contain_volatile_functions in clauses.c says...
src/backend/optimizer/util/clauses.c:** XXX we do not examine sub-selects to see if they contain uses of* volatile
functions. It's not real clear if that is correct or not...*/ 


but this example seems to clarify (or at least i think) that we have to avoid
pulling up subquerys containing volatile functions:

--- BEGIN SQL ---
create view vfoo_random as
select alu_codigo, is_truefrom (select alu_codigo, (random() * 5) as is_true        from rec_m_alumno) as t_tmpwhere
is_true> 1; 

select count(*) from vfoo_random where is_true < 1;

drop view vfoo_random;
--- END SQL ---


i thought it was just calling contain_volatile_function from
is_simple_subquery() in src/backend/optimizer/prep/prepjointree.c but it doesn't
work for me.
what i miss?

--
regards,
Jaime Casanova
(DBA: DataBase Aniquilator ;)


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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Kerberos brokenness and oops question in 8.1beta2
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Issue is changing _bt_compare function and