Re: [HACKERS] seq scan only when function not in subquery (bug?)
| От | Brett McCormick |
|---|---|
| Тема | Re: [HACKERS] seq scan only when function not in subquery (bug?) |
| Дата | |
| Msg-id | 13702.56712.737998.57600@web0.speakeasy.org обсуждение |
| Ответ на | Re: [HACKERS] seq scan only when function not in subquery (bug?) (Vadim Mikheev <vadim@krs.ru>) |
| Ответы |
Re: [HACKERS] seq scan only when function not in subquery (bug?)
|
| Список | pgsql-hackers |
On Tue, 16 June 1998, at 10:32:39, Vadim Mikheev wrote:
> Another issue - handling of functions with constant args
> in queries - for query
>
> select * from T where A = upper ('bbb')
>
> function upper ('bbb') will be executed for each tuple in T!
> More of that - if there is index on T(A) then this index will
> not be used for this query!
> Obviously, upper ('bbb') should be executed (by Executor, not
> parser/planner) once: new Param type (PARAM_EXEC) implemented
> for subselects could help here too...
> ---
>
> Actually, this is easy to fix...
I was going to reply to this but never did -- how do you tell if it
needs to be executed once per query or once per tuple? What if you
wanted to call a function which returned a different value for each
tuple, like random()?
В списке pgsql-hackers по дате отправления: