Docsity

Synopsis Data Structures for Massive Data Sets, Exercises of Data Structures and Algorithms

Toggle sidebar
bg1
Synopsis Data Structures for Massive Data Sets
Phillip B. Gibbons
Yossi Matias
y
1Introduction
A growing number of applications demand algorithms
and data structures that enable the ecient processing
of data sets with gigabytes to terabytes to petabytes
of data. Such massive data sets necessarily reside on
disks or tapes, making even a few accesses of the base
data set comparably slow (e.g., a single disk access is
often 10
000 times slower than a single memory access).
This short note (see 8] for the full paper) considers
data structures for supporting queries to massive data
sets, while minimizing or avoiding disk accesses. In
particular, weadvocate and study the use of small space
data structures.
We denote as
synopsis data structures
any data
structures that are substantively smaller than their base
data sets. A synopsis data structure has the following
advantages over a non-synopsis (e.g., linear space) data
structure: (a) it may reside in main memory, enabling
query responses and data structure updates that avoid
disk accesses altogether, (b) it can be transmitted
remotely at minimal cost, (c) it has minimal impact
on the overall storage costs of a system, (d) it leaves
space in the memory for other processing (available
main memory is a precious resource for external memory
algorithms), and (e) it can serve as a small surrogate for
data sets that are currently expensive or impossible to
access. Hence a traditional viewpoint in the algorithms
literature | that a linear space data structure is a
good one | is not appropriate for massive data sets,
as such data structures often fail to provide satisfactory
application p erformance.
On the other hand, since synopsis data structures
are too small to maintainafullcharacterization of their
base data sets, they must summarize the data set, and
the responses they provide to queries will typically be
approximate ones. The challenges are to determine (1)
Information Sciences Research Center, Bell Lab oratories,
600 Mountain Avenue, Murray Hill, NJ 07974. Email:
gibbons@research.bell-labs.com.
y
Department of Computer Science, Tel-Aviv University,Tel-
Aviv 69978 Israel, and Information Sciences Research Center, Bell
Laboratories. Email: [email protected]. Research supported
in part byanAlonFellowship, by the Israel Science Foundation
founded by The Academy of Sciences and Humanities, and bythe
Israeli Ministry of Science.
what synopsis of the full data set to keep in the limited
space in order to maximize the accuracy and condence
of its approximate responses, and (2) how to eciently
compute the synopsis and maintain it in the presence of
updates to the data set.
Due to their importance in applications, there are
a number of synopsis data structures in the literature
and in existing systems. Examples include uniform and
biased random samples, various types of histograms,
statistical summary information such as frequency mo-
ments, data structures resulting from lossy compression
of the data set, etc. Often, synopsis data structures
are used in aheuristic way, with no formal properties
proved on their performance or accuracy, especially un-
der the presence of updates to the data set. Our ongoing
work since 1995 seeks to provide a systematic study of
synopsis data structures, focusing on p erformance and
accuracy guarantees, even in the presence of data up-
dates.
2 Results
In the full paper, we describe a context for algorithmic
work relevant to massive data sets and a framework for
evaluating such work. In brief, we combine the PDM
external memory mo del 15] with input/output conven-
tions more typical for the study of (online) data struc-
ture problems. Two general scenarios are considered:
one where the input resides on the disks of the PDM
and one where the input arrives online in the PDM
memory. We describe some of our w
ork on synopsis
data structures, and highlight results on three problem
domains from the database literature: hot list queries,
histograms and quantiles, and frequency moments.
Hot list queries.
A
hot list
is an ordered set of
h
value, count
i
pairs for the most frequently occurring
\values" in a data set. Hot lists are used in a variety
of data analysis contexts, including fraud detection,
best sellers lists, market basket analysis, selectivity
estimation in query optimization, load balancing in
parallel query optimization, etc. Note that hot lists
are trivial to maintain given sucient space to hold
afull histogram of the data set how
ever, for many
data sets, the histogram would not b e a synopsis data
structure. Weshow in 1] that there are no synopsis data
structures for estimating even the count of the most
1
pf2

Partial preview of the text

Download Synopsis Data Structures for Massive Data Sets and more Exercises Data Structures and Algorithms in PDF only on Docsity!

Synopsis Data Structures for Massive Data Sets

Phillip B Gibb ons^ Yossi Matiasy

Intro duction

A growing numb er of applications demand algorithms and data structures that enable the ecient pro cessing of data sets with gigabytes to terabytes to p etabytes of data Such massive data sets necessarily reside on disks or tap es making even a few accesses of the base data set comparably slow eg a single disk access is often   times slower than a single memory access This short note see  for the full pap er considers data structures for supp orting queries to massive data sets while minimizing or avoiding disk accesses In particular we advo cate and study the use of small space data structures We denote as synopsis data structures any data structures that are substantively smaller than their base data sets A synopsis data structure has the following advantages over a non synopsis eg linear space data structure a it may reside in main memory enabling query resp onses and data structure up dates that avoid disk accesses altogether b it can b e transmitted remotely at minimal cost c it has minimal impact on the overall storage costs of a system d it leaves space in the memory for other pro cessing available main memory is a precious resource for external memory algorithms and e it can serve as a small surrogate for data sets that are currently exp ensive or imp ossible to access Hence a traditional viewp oint in the algorithms literature that a linear space data structure is a go o d one is not appropriate for massive data sets as such data structures often fail to provide satisfactory application p erformance On the other hand since synopsis data structures are to o small to maintain a full characterization of their base data sets they must summarize the data set and the resp onses they provide to queries will typically b e approximate ones The challenges are to determine 

(^) Information Sciences Research Center Bell Lab oratories  Mountain Avenue Murray Hill NJ  Email gibb onsresearchb ell labscom y (^) Department of Computer Science Tel Aviv University Tel Aviv  Israel and Information Sciences Research Center Bell Lab oratories Email matiasmathtauacil Research supp orted in part by an Alon Fellowship by the Israel Science Foundation founded by The Academy of Sciences and Humanities and by the Israeli Ministry of Science

what synopsis of the full data set to keep in the limited space in order to maximize the accuracy and con dence of its approximate resp onses and  how to eciently compute the synopsis and maintain it in the presence of up dates to the data set Due to their imp ortance in applications there are a numb er of synopsis data structures in the literature and in existing systems Examples include uniform and biased random samples various typ es of histograms statistical summary information such as frequency mo ments data structures resulting from lossy compression of the data set etc Often synopsis data structures are used in a heuristic way with no formal prop erties proved on their p erformance or accuracy esp ecially un der the presence of up dates to the data set Our ongoing work since  seeks to provide a systematic study of synopsis data structures fo cusing on p erformance and accuracy guarantees even in the presence of data up dates

 Results In the full pap er we describ e a context for algorithmic work relevant to massive data sets and a framework for evaluating such work In brief we combine the PDM external memory mo del  with inputoutput conven tions more typical for the study of online data struc ture problems Two general scenarios are considered one where the input resides on the disks of the PDM and one where the input arrives online in the PDM memory We describ e some of our work on synopsis data structures and highlight results on three problem domains from the database literature hot list queries histograms and quantiles and frequency moments Hot list queries A hot list is an ordered set of hvalue counti pairs for the most frequently o ccurring values in a data set Hot lists are used in a variety of data analysis contexts including fraud detection b est sellers lists market basket analysis selectivity estimation in query optimization load balancing in parallel query optimization etc Note that hot lists are trivial to maintain given sucient space to hold a full histogram of the data set however for many data sets the histogram would not b e a synopsis data structure We show in  that there are no synopsis data structures for estimating even the count of the most

frequently o ccurring value to within constant factors over all distributions On the other hand we present in  new synopsis data structures that are shown b oth analytically and exp erimentally to pro duce more accurate approximate hot lists than previous metho ds and p erform quite well for the skewed distributions that are of interest in practice See also  for a recent study of a related problem Maintaining histograms and quantiles His tograms approximate a data set by grouping values into buckets subsets and approximating the distribution of values in the data set based on summary statistics maintained in each bucket see eg   They are used extensively in commercial databases for selectiv ity estimation purp oses within a query optimizer and in query execution A common problem with histograms is keeping them up to date in the presence of data up dates We present in  algorithms for fast dynamic maintenance of highly accurate approximate histograms for the most widely used classes of histograms Addi tional recent work is given in    Frequency moments Estimating the numb er of distinct values in a data set is a problem that frequently o ccurs in database applications From an algorithmic p oint of view it demonstrates the advantages of viewing the input online using a synopsis data structure vs only sampling from the input Indeed the algorithms in   demonstrate eective synopsis data structures of size O log n for the online problem whereas n space is required for any sampling only approach regardless of the estimator used   Synopsis data structures for other frequency moments are presented in   as well as corresp onding size lower b ounds Other results A recent survey by Barbara et al  describ es and qualitatively evaluates the state of the art in data reduction techniques Our work on synopsis data structures also includes the use of multi fractals and wavelets for synopsis data structures    and join synopses for queries on the join of multiple sets This work is part of the Approximate query answering Aqua pro ject   at Bell Labs Aqua seeks to provide fast approximate answers to queries using synopsis data structures While synopsis data structures have b een prop osed and studied for a numb er of query problems see the full pap er for additional examples many more op en questions remain and we hop e that this short note will motivate others in the algorithms community to study these problems

References

 N Alon Y Matias and M Szegedy The space com plexity of approximating the frequency moments in

Pro c th ACM Symp on the Theory of Computing May  pp   Full version to app ear in JCSS sp ecial issue for STOC   D Barbara et al The New Jersey data reduction report Bulletin of the Technical Committee on Data Engineering   pp    S Chaudhuri R Motwani and V Narasayya Ran dom sampling for histogram construction How much is enough in Pro c ACM SIGMOD Int l Conf on Man agement of Data June  pp    C Faloutsos Y Matias and A Silb erschatz Modeling skewed distribution using multifractals and the  law in Pro c rd Int l Conf on Very Large Data Bases Sept  pp     M Fang N Shivakumar H GarciaMolina R Mot wani and J D Ullman Computing iceberg queries ef ciently in Pro c th Int l Conf on Very Large Data Bases Aug  pp     P Fla jolet and G N Martin Probabilistic counting algorithms for data base applications J Computer and System Sciences   pp     P B Gibb ons and Y Matias New samplingbased sum mary statistics for improving approximate query an swers in Pro c ACM SIGMOD Int l Conf on Manage ment of Data June  pp     Synopsis data structures for massive data sets DIMACS Series in Discrete Mathematics and Theo retical Computer Science  To app ear Avail able as Bell Labs tech rep Sept  and at httpwwwb elllabscompbgibb ons  P B Gibb ons Y Matias and V Po osala Aqua project white paper tech rep Bell Lab oratories Murray Hill New Jersey Dec    ^ Fast^ incremental^ maintenance^ of^ approximate histograms in Pro c rd Int l Conf on Very Large Data Bases Aug  pp    P B Gibb ons V Po osala S Acharya Y Bartal Y Matias S Muthukrishnan S Ramaswamy and T Suel AQUA System and techniques for approxi mate query answering tech rep Bell Lab oratories Murray Hill New Jersey Feb   G S Manku S Ra jagopalan and B G Lindsley Approximate medians and other quantiles in one pass and with limited memory in Pro c ACM SIGMOD Int l Conf on Management of Data June  pp    Y Matias J S Vitter and M Wang Waveletbased histograms for selectivity estimation in Pro c ACM SIGMOD Int l Conf on Management of Data June  pp    V Po osala Y E Ioannidis P J Haas and E J Shekita Improved histograms for selectivity estimation of range predicates in Pro c ACM SIGMOD Int l Conf on Management of Data June  pp     J S Vitter and E A M Shriver Algorithms for paral lel memory I Twolevel memories Algorithmica   pp