db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: jira question
Date Wed, 03 Aug 2005 18:30:04 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Manish Khettry wrote:<br>
<blockquote cite="midee56416050803105171b3af4c@mail.gmail.com"
 type="cite">
  <pre wrap="">I think using arbitrarily complex expressions to create indexes may be
overkill. Dan's idea of restricting expression indexes on function
calls on a single base column (actually one _or more_ base columns
shouldn't be that much harder) is probably better.
  </pre>
</blockquote>
While it may be OK to start with a single base column, I think one or
more base column references would be good to support. Useful for
functional indexes on <b>area</b>, for example. Or total compensation,
which may involve base salary, bonus, commissions etc.<br>
<blockquote cite="midee56416050803105171b3af4c@mail.gmail.com"
 type="cite">
  <pre wrap="">Isn't storing the expression text for a generated column also
problematic? I can think of a few other things
-- The expression will also have to be compiled and evaluated for DDL
like alter table (drop column)  possibly others.
  </pre>
</blockquote>
Doesn't Derby already support evaluating an expression at DDL time for
a default clause? Alter table add column evaluates this default
expression at the DDL time.<br>
<blockquote cite="midee56416050803105171b3af4c@mail.gmail.com"
 type="cite">
  <pre wrap="">-- We'll need a good way to check if two expressions are the same.
Obviously a textual comparison may not work. Making sure that two
expr's are the same is not trivial if we want to do it right-- say
(x+y) &gt; 10 is the same as 10 &lt; (y+x).
  </pre>
</blockquote>
Right... Common expression detection needs to be added. Would also be
useful to eliminate multiple evaluations of any common
(sub-)expressions.<br>
<br>
Satheesh<br>
<blockquote cite="midee56416050803105171b3af4c@mail.gmail.com"
 type="cite">
  <pre wrap="">Manish

On 8/3/05, Rick Hillegas <a class="moz-txt-link-rfc2396E" href="mailto:Richard.Hillegas@sun.com">&lt;Richard.Hillegas@sun.com&gt;</a>
wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Thanks, Jeff. I agree. Recompiling these expressions can occur when
we
compile the triggering SELECT/UPDATE/INSERT statements. Compiling a
SELECT/UPDATE/INSERT is a relatively heavyweight operation and I don't
think anyone will notice a little extra time spent recompiling these
expressions.

Cheers,
-Rick

Jeffrey Lichtman wrote:

    </pre>
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">The expression used for the generated column must be stored in
the
data dictionary. Does derby serialize expressions? I was looking
around in the classes in impl/sq/compile (ValueNode and such) and
these classes don't seem to implement Formatable.
        </pre>
      </blockquote>
      <pre wrap="">
It would be better to store the expressions as text, and to parse and
bind them when needed. I learned the hard way while working on the
internals of other database systems that storing internal data
structures in the data dictionary causes trouble when the structures
change. Also, it's useful for users to be able to look at the text of
their DDL statements.


                       -        Jeff Lichtman
                                <a class="moz-txt-link-abbreviated" href="mailto:swazoo@rcn.com">swazoo@rcn.com</a>
                                Check out Swazoo Koolak's Web Jukebox at
                                <a class="moz-txt-link-freetext" href="http://swazoo.com/">http://swazoo.com/</a>
      </pre>
    </blockquote>
    <pre wrap="">


    </pre>
  </blockquote>
  <pre wrap=""><!---->


  </pre>
</blockquote>
</body>
</html>


Mime
View raw message