| From: | Brett McCormick <brett(at)work(dot)chicken(dot)org> |
|---|---|
| To: | Vadim Mikheev <vadim(at)krs(dot)ru> |
| Cc: | pgsql-hackers(at)hub(dot)org |
| Subject: | Re: [HACKERS] seq scan only when function not in subquery (bug?) |
| Date: | 1998-06-16 21:03:04 |
| Message-ID: | 13702.56712.737998.57600@web0.speakeasy.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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()?
| From | Date | Subject | |
|---|---|---|---|
| Next Message | De Clarke | 1998-06-16 21:25:18 | group by : syntactic example (sybase) |
| Previous Message | Brett McCormick | 1998-06-16 20:58:40 | Re: [HACKERS] non-functional update notice unneccesarily |