<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
As I mentioned to Ian separately, my priority is integrating the "postmodern" backend over modifying the Postgres back end, as this may very well be a much superior backend in terms of performance, and easily usable by anyone using Postgres now.<BR>
<BR>
Stored procedures tend to not be very portable; therefore to put them in the current "postgres" backend, which should really be called a "clsql" backend, would make it less likely to work with MySQL.<BR>
<BR>
However, this raises and interesting question: Is performance a significant problem (at least for the Postgres users?) If you had a "wish list" for Elephant features, would better performance be at the top?<BR>
<BR>
<BR>
<BR>
<BR>
On Tue, 2007-04-03 at 09:30 -0400, Ian Eslick wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Do you mean stored between sessions, stored in-memory between uses, </FONT>
<FONT COLOR="#000000">or stored on the DB to avoid sending queries back and forth? My </FONT>
<FONT COLOR="#000000">understanding is that Tthe expense of a SQL query is not so much in </FONT>
<FONT COLOR="#000000">the parsing as it is in forming a query plan to execute. The server </FONT>
<FONT COLOR="#000000">stores query plans, but exposing parameters of the SQL statement via </FONT>
<FONT COLOR="#000000">a procedure, so that they do not need to be fully recomputed later.</FONT>
<FONT COLOR="#000000">My intention is to focus on supporting high-performance in Berkeley </FONT>
<FONT COLOR="#000000">DB and any native-lisp backends, but not to focus on doing stored </FONT>
<FONT COLOR="#000000">procedures for the SQL backend. (Although that would be a nice </FONT>
<FONT COLOR="#000000">enhancement project for the SQL backend, at least for the SQL calls </FONT>
<FONT COLOR="#000000">that emulate the BDB semantics on top of relational tables).</FONT>
<FONT COLOR="#000000">So my thinking is this. A query compiler will compile a constraint </FONT>
<FONT COLOR="#000000">expression into a closure if it is in a compiled code block, much </FONT>
<FONT COLOR="#000000">like cl-ppcre handles compiling regex's. That closure will contain a </FONT>
<FONT COLOR="#000000">fully compiled query execution code block, based on the computed </FONT>
<FONT COLOR="#000000">query plan.</FONT>
<FONT COLOR="#000000">(map-query fn '(query ...)) ==></FONT>
<FONT COLOR="#000000"> (apply query-closure fn free-params)</FONT>
<FONT COLOR="#000000">A query closure is a mapping function. You can also generate query </FONT>
<FONT COLOR="#000000">closures and pass them around as first class objects, but you'll have </FONT>
<FONT COLOR="#000000">to keep track of the order of any arguments that bind to free </FONT>
<FONT COLOR="#000000">parameters. I'm still working out these kinds of details. The </FONT>
<FONT COLOR="#000000">interpreter has to be completed and validated first.</FONT>
<FONT COLOR="#000000">Ian</FONT>
<FONT COLOR="#000000">On Apr 3, 2007, at 8:41 AM, Pierre THIERRY wrote:</FONT>
<FONT COLOR="#000000">> Recently, a discussion started in the Torque project, an ODB for Java</FONT>
<FONT COLOR="#000000">> that also provides persistence, about the possible use of stored</FONT>
<FONT COLOR="#000000">> procedures instead of building SQL requests, because for frequent </FONT>
<FONT COLOR="#000000">> cheap</FONT>
<FONT COLOR="#000000">> operations, the overhead of parsing and executing SQL can be</FONT>
<FONT COLOR="#000000">> non-trivial.</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Do you think such DB-specific optimisations could make sense in </FONT>
<FONT COLOR="#000000">> Elephant</FONT>
<FONT COLOR="#000000">> too?</FONT>
<FONT COLOR="#000000">></FONT>
<FONT COLOR="#000000">> Curiously,</FONT>
<FONT COLOR="#000000">> Pierre</FONT>
<FONT COLOR="#000000">> -- </FONT>
<FONT COLOR="#000000">> <A HREF="mailto:nowhere.man@levallois.eu.org">nowhere.man@levallois.eu.org</A></FONT>
<FONT COLOR="#000000">> OpenPGP 0xD9D50D8A</FONT>
<FONT COLOR="#000000">> _______________________________________________</FONT>
<FONT COLOR="#000000">> elephant-devel site list</FONT>
<FONT COLOR="#000000">> <A HREF="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</A></FONT>
<FONT COLOR="#000000">> <A HREF="http://common-lisp.net/mailman/listinfo/elephant-devel">http://common-lisp.net/mailman/listinfo/elephant-devel</A></FONT>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">elephant-devel site list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:elephant-devel@common-lisp.net">elephant-devel@common-lisp.net</A></FONT>
<FONT COLOR="#000000"><A HREF="http://common-lisp.net/mailman/listinfo/elephant-devel">http://common-lisp.net/mailman/listinfo/elephant-devel</A></FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>