Hi, everyone.
My colleagues and I have developed a music-information service using PHP4, PostgreSQL, Oracle8i, and loadbalancing hardware (website plug: check it out at <!-- m --><a class="postlink" href="http://dotclick.com;">http://dotclick.com;</a><!-- m --> you need to download our minibrowser Windows client--and, yes I know we need client packages for Linux and Mac!).
Now we're trying to move to the next level of performance, sorting out how to get Oracle8i to scream.
Oracle has a scheme whereby it can retain SQL statements in a ready-to-execute form, and re-use them over and over again. This saves lots of Oracle CPU time, because it doesn't have to re-create the so-called "execution plan" each time it sees a statement. This sort of optimization is obviously ideal for a web application. To exploit this, one must use bound variables in OCI8 from PHP. We've done this.
We're also using OCIPLogon from within mod_php; this works nicely.
Now the hard-core question. Oracle client-server applications have the notion of re-using the same SQL over and over again inside the client (this is a separate step of reusability than the parse cache mentioned earlier). Each PHP/Apache process is a separate Oracle client. But, because the web is stateless, obviously most SQL statements get used just once in the creation of a single web page. Is there any way anyone knows of to do an OCIParse just once in a particular PHP/Apache instance, then leave the parsed statement around as a global reusable resource for the life of the Apache instance?
My colleagues and I have developed a music-information service using PHP4, PostgreSQL, Oracle8i, and loadbalancing hardware (website plug: check it out at <!-- m --><a class="postlink" href="http://dotclick.com;">http://dotclick.com;</a><!-- m --> you need to download our minibrowser Windows client--and, yes I know we need client packages for Linux and Mac!).
Now we're trying to move to the next level of performance, sorting out how to get Oracle8i to scream.
Oracle has a scheme whereby it can retain SQL statements in a ready-to-execute form, and re-use them over and over again. This saves lots of Oracle CPU time, because it doesn't have to re-create the so-called "execution plan" each time it sees a statement. This sort of optimization is obviously ideal for a web application. To exploit this, one must use bound variables in OCI8 from PHP. We've done this.
We're also using OCIPLogon from within mod_php; this works nicely.
Now the hard-core question. Oracle client-server applications have the notion of re-using the same SQL over and over again inside the client (this is a separate step of reusability than the parse cache mentioned earlier). Each PHP/Apache process is a separate Oracle client. But, because the web is stateless, obviously most SQL statements get used just once in the creation of a single web page. Is there any way anyone knows of to do an OCIParse just once in a particular PHP/Apache instance, then leave the parsed statement around as a global reusable resource for the life of the Apache instance?