Re: [PERFORM] Seq scan on zero-parameters function
Re: [PERFORM] Seq scan on zero-parameters function
От:
Tomasz Myrta <jasiek@klaster.net>
Дата:
Dnia 2004-02-06 09:43, Użytkownik Octavio Alvarez napisał: > Thanks for the hint. > > In fact, my current_period_id() is based on time, but it should be > constant along the query execution. I mean, I don't want some records > filtered with some values and other with other values... I'll have an > uncongruent recordset. Well - you didn't read the chapter I noticed you, did you? Look at function now(). It returns always the same value inside transaction. If your current_period_id() works the same way as now() then declare it as STABLE. Regards, Tomasz Myrta
Re: [PERFORM] Seq scan on zero-parameters function
От:
"Octavio Alvarez" <alvarezp@alvarezp.ods.org>
Дата:
Tomasz Myrta said: > Dnia 2004-02-06 09:43, U¿ytkownik Octavio Alvarez napisa³: >> Thanks for the hint. >> >> In fact, my current_period_id() is based on time, but it should be >> constant along the query execution. I mean, I don't want some records >> filtered with some values and other with other values... I'll have an >> uncongruent recordset. > > Well - you didn't read the chapter I noticed you, did you? Huummm.. No... :-$ But now I did. Although the chapter makes it look as "how will the optimizer think the function behaves", not "how the function actually behaves". But thanks. It's a lot clearer now. I assume that if I want to make "timeofday" have a stable-behavior, I must enclose it in a sub-query. Am I right? -- Octavio Alvarez. E-mail: alvarezp@alvarezp.ods.org. Agradezco que sus correos sean enviados siempre a esta dirección.