Subject: TSQL Benchmark: Task 4

From: "Christian S. Jensen" <[email-masked]>
Date: Tue, 11 May 1993 01:00:01 +0200

**********************************************************************
**                      The TSQL Benchmark                          **
**                   Task 4--Benchmark Queries                      **
**********************************************************************

Dear colleague,

In a recent message to this list, Rick Snodgrass proposed that we move
on to Task 4 of the benchmark initiative, that of finding the actual
benchmark queries. Rick argued convincingly, and there have been no
objections. Consequently, I now propose a strategy for populating the
current taxonomy with benchmark queries.

Classification of queries
*************************

In a separate message, you will find the current version of the
benchmark document. (The document describing the first three tasks may
also be obtained by anonymous ftp from cs.arizona.edu, where it may be
found in the tsql directory as "bmT123".) When reading the following,
please refer to the taxonomy section of that document.

The classification in Figure 7 gives rise to thirty classes of
queries. Following that figure, we first classify queries according to
the output. The output from a query may have either only an
explicit-attribute value component (O1), only a valid-time component
(O2), or it may have both (O3)

Each of these classes has ten constituent classes. To derive these
classes, we divide queries based on a single, distinguished valid-time
selection predicate (chosen from possibly several predicates by the
individual contributor). The predicate is of the format arg_1 op arg_2
where op is a comparison operator which may (or may not) be
duration-based. One argument is the valid time of tuples in the
argument relation. The other argument may be of event, interval, or
element type; orthogonally, it may (or may not) be computed from
existing valid times in the argument relation. This results in a total
of ten classes.

                (S1) (Duration, Interval, Computed)
                (S2) (Duration, Interval, Other)
                (S3) (Duration, Element, Computed)
                (S4) (Duration, Element, Other)
                (S5) (Other, Event, Computed)
                (S6) (Other, Event, Other)
                (S7) (Other, Interval, Computed)
                (S8) (Other, Interval, Other)
                (S9) (Other, Element, Computed)
               (S10) (Other, Element, Other)

The thirty classes are now numbered O1.S1, ..., O1.S10, O2.S1, ...,
O2.S10, O3.S1, ..., O3.S10.

Strategy for populating the benchmark with queries
**************************************************

I request that each author
                   (1) chooses two of these classes (classes are
		       allocated on a first-come-first-serve basis)
                   (2) prepare 5 queries for each class, and
                   (3) send the queries to this mailing list by end of
	               Sunday, May 30.

If you are not already an author, you may become an author by
proposing queries for one or more classes.

Next, I request that use the template for queries that I have
prepared.

\query{The query goes here.}
      {The answer goes here.}
      {The category according to Figure 6 goes here.}

Immediately following is a Latex document that may be used when
viewing queries. The document also provides additional explanation.
Note that this additional explanation is added here to explain the
categories and classes. Such explanation is not required in the
submitted queries.

Best regards,
Christian S. Jensen, editor
Aalborg University
[email-masked]

\documentstyle[11pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Latex template for queries
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addtolength{\textwidth}{1.485in} \setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in} \addtolength{\topmargin}{-.85in}
\addtolength{\textheight}{1.8in}

\long\def\comment#1{}

\long\def\query#1#2#3{\begin{verse} {\bf Query \no} {#1} \end{verse}
\begin{verse} {\bf Answer:} {#2} \end{verse} \begin{verse} {\bf
Category:} {#3} \end{verse}}

\newcounter{qnumber}
\newcounter{rnumber}[subsection]
\newcounter{gnumber}[subsubsection]
\newcommand{\no}{\setcounter{qnumber}{\value{subsection}}
\setcounter{rnumber}{\value{subsubsection}}\protect\refstepcounter{gnumber}
Q \protect\theqnumber.\protect\thernumber.\protect\thegnumber:}

\begin{document}

\subsection{Example With Explanations}

\subsubsection{Class O1.S3 (Duration, Element, Computed)}

\query{Find the names of employees that have been in a department
  named Toy for a shorter period than has DI.} 
  {``Ed'' and ``Edward.''}
  {(Projected, None) / (Duration, Element, Computed) / (=, Constant)
    (=, Constant)}

  \noindent {\it The employee ED has been in a department named Toy
    for a period which is shorter than that of DI. The categorization
    is with respect to Figure 6. ``(Projected, None)'' indicates that
    only part of the attributes of the argument relation are present
    in the result and that there is no valid-time component. Next,
    ``(Duration, Element, Computed)'' indicates that a duration based
    predicates is used on element-valued arguments which are both
    derived from the valid-times of stored facts.  Finally, ``(=,
    Constant) (=, Constant)'' indicates that there are two
    non-temporal selection predicates that test for equality of an
    attribute value with a constant (i.e., the person must be DI and
    the department must have name Toy).}

\query{Find the current name and department name for the persons which
  made \$40K for a longer period than DI did.}
  {``(Edward, Book).''}
  {(Projected, None) / (Duration, Element, Computed) (Containment,
    Event, Explicit) / (=, Constant)}

  \noindent {\it In this query, there are two valid-time selection
    based predicates.  The one used for categorization compares the
    duration of time when a person makes \$40K with the period of time
    that DI makes \$40K. The other selects the name and department
    that overlap with the current time of qualifying persons.}

\end{document}