as suffix of attribute names. Example 5 illustrates the
harmonizing of aliases.
Example 5: Alias harmonization
Before performing the alias harmonization, the
query trees of Q
2
and Q
4
are:
Q
2
: π
a
∗
− σ
A=4∧B=5
− ρ
T1
−
TABLE1
Q
4
: π
a
∗
− σ
A=4∧B=5
− ρ
T2
−
TABLE1
Both queries contain only one renaming opera-
tion each (Q
2
:
TABLE1
→
T1
, Q
2
:
TABLE1
→
T2
).
They rename
TABLE1
but do not use the alias in
any other operation. The md5-hash of
TABLE1
is
d20a1138c815109c831e910488ebf146. Hence, the
modified trees are:
Q
2
: π
a
∗
− σ
A=4∧B=5
− ρ
@ d20a...bf146
1
−
TABLE1
Q
4
: π
a
∗
− σ
A=4∧B=5
− ρ
@ d20a...bf146
1
−
TABLE1
Q
2
and Q
4
are now syntactically equivalent.
4 SUMMARY AND OUTLOOK
Due to the increasing complexity of mobile applica-
tions, query indexing is an emerging topic in research
and practice. In this paper we presented first ideas
towards finding a compact representation of semanti-
cally equivalent database queries. Our approach re-
duces the syntactical complexity of database queries
(1) by applying well known and proofed transfor-
mation rules, (2) by forcing an order within logi-
cal expressions, and (3) by normalizing the names
of attributes and relations. All algorithms are of
a deterministic nature, except the optimization of
the where-condition. For this reason, we can not
guarantee to transform all semantically equivalent
queries to the same index entry. This might re-
sult in some duplicates in the query index, which
might be acceptable for semantic caching and many
other application areas. Thus, we can already de-
clare success if we find rules that are applicable
to the majority of real-world queries. As part of
our ongoing research we plan to address further
cases of semantic equivalence. Examples include
self-joins like
SELECT * FROM T1 AS A, T2 AS B
WHERE A.a = B.b
and
SELECT * FROM T1 AS B,
T2 AS A WHERE A.a = B.b
. Both are equivalent
but represented in a different way. A solution could be
to order the From-list lexicographically. Furthermore,
we intend to evaluate our approach by implementing
a prototype that can be tested with well-known query
mixes, e.g., the TCP-H benchmark.
REFERENCES
Biswas, N. N. (1984). Computer aided minimization proce-
dure for boolean functions. In Proceedings of the 21st
conference on Design automation.
Dayal, U., Goodman, N., and Katz, R. H. (1982). An ex-
tended relational algebra with control over duplicate
elimination. In Proceedings of the SIGACT-SIGMOD
Symposium on Principles of Database Systems.
Elmasri, R. and Navathe, S. B. (2007). Fundamentals of
Database Systems. Addison Wesley.
Gray, J., Helland, P., O’Neil, P., and Shasha, D. (1996).
The Dangers of Replication and a Solution. SIGMOD
Record, 25(2):173–182.
Grefen, P. W. and de By, R. A. (1994). A multi-set extended
relational algebra: a formal approach to apractical is-
sue. In Proceedings of the 10th ICDE.
Gupta, A., Harinarayan, V., and Quass, D. (1995).
Aggregate-Query Processing in Data Warehousing
Environments. In Proceedings of the 21st VLDB.
H¨opfner, H. (2007). Query Based Client Indexing in
Client/Server Information Systems. Journal of Com-
puter Science, 3(10):773–779.
H¨opfner, H. and Sattler, K.-U. (2003). Towards Trie-Based
Query Caching in Mobile DBS. In Proceedings of
the Workshop Scalability, Persistence, Transactions -
Database Mechanisms for Mobile Applications.
Karnaugh, M. (1953). The Map Method for Synthesis of
Combinational Logic Circuits. Transactions of Amer-
ican Institute of Electrical Engineers, 72(7):593–599.
Kuenning, G. H. and Popek, G. J. (1997). Automated
Hoarding for Mobile Computers. ACM SIGOPS Op-
erating Systems Review, 31(5):264–275.
Lee, K. C. K., Leong, H. V., and Si, A. (1999). Semantic
query caching in a mobile environment. ACM SIG-
MOBILE Mobile Computing and Communications
Review, 3(2):28–36.
McCluskey, E. J. (1956). Minimization of Boolean Func-
tions. Bell System Techical Journal, 35(5):1417–1444.
Quine, W. V. O. (1952). The problem of Simplifying
Truth functions. American Mathematics Monthly,
59(8):521–531.
Rivest, R. L. (1992). The MD5 Message-Digest Algo-
rithm. Informational Errata.
http://tools.ietf.
org/html/rfc1321
.
Russell, S. J. and Norvig, P. (2002). Artificial Intelligence:
A Modern Approach.
TOWARDS COMPACT OPERATOR TREES FOR QUERY INDEXING
179