From ellis at stat.harvard.edu  Wed Dec 13 01:16:33 2006
From: ellis at stat.harvard.edu (Byron Ellis)
Date: Tue, 12 Dec 2006 16:16:33 -0800
Subject: [Rd] Pre-compilation and server-side parallel execution
In-Reply-To: <45797BFB.3090302@erik.prutser.cx>
References: <45797BFB.3090302@erik.prutser.cx>
Message-ID: <7098abec0612121616q11ab9185n2eb79942e2168cba@mail.gmail.com>

On 12/8/06, Erik van Zijst <r at erik.prutser.cx> wrote:
> 2. R's native C-api
> [http://cran.r-project.org/doc/manuals/R-exts.html#The-R-API] does not
> separate parsing from evaluation. When the same script is evaluated 10
> times, it is also parsed 10 times.
>
> I'm mostly concerned about the second issue. Our scripts are registered
> once and continuously evaluated. I want to avoid parsing the same script
> again each time it is evaluated. Does the engine recognize previously
> parsed scripts (like oracle does for SQL queries)?

A database server is doing rather more than simply parsing a
query--it's also running a query planner to optimize execution and
quite possibly a number of other things so it behooves the DBMS to
cache that information whenever possible. The closest functional
equivalent in R would be wrapping everything in a function and then
serializing the resulting function somewhere.



[Rd] Pre-compilation and server-side parallel execution
Byron Ellis