Home
The Toolkit for Online Communities
15898 Community Members, 0 members online, 2365 visitors today
Log In Register

Forum OpenACS Development: Re: PREPARE considered beneficial

OpenACS Home : Forums : OpenACS Development : Re: PREPARE considered beneficial : One Message

+
Posted by Alfred Werner on
To stretch it - I wonder if postresql is smart enough to recognize invariant subselects and keep those or if it runs the optimizer each time (in the case of sorted results). If it CAN recognize subselects, an additional layer of nesting might keep things fast (?)

e.g.

select a,b from foo where a=:a, b=:b order by $a_or_b;
select a,b from (select a,b from foo where a=:a, b=:b) order by $a_or_b;