Query Size Estimation for Joins Using Systematic Sampling

  • Authors:
  • A. H. H. Ngu;B. Harangsri;J. Shepherd

  • Affiliations:
  • Department of Computer Science, Texas State University, San Marcos, Texas, USA. angu@swt.edu;National Electronics and Computer Technology, 112 Thailand Science Park, Paholyothin Rd., Pathumthani 12120, Thailand. banchong@notes.nectec.or.th;School of Computer Science and Engineering, University of New South Wales, 2052, Sydney, Australia. jas@cse.unsw.edu.au

  • Venue:
  • Distributed and Parallel Databases
  • Year:
  • 2004

Quantified Score

Hi-index 0.01

Visualization

Abstract

We propose a new approach to the estimation of query result sizes for join queries. The technique, which we have called “systematic sampling—SYSSMP”, is a novel variant of the sampling-based approach. A key novelty of the systematic sampling is that it exploits the sortedness of data; the result of this is that the sample relation obtained well represents the underlying frequency distribution of the join attribute in the original relation.We first develop a theoretical foundation for systematic sampling which suggests that the method gives a more representative sample than the traditional simple random sampling. Subsequent experimental analysis on a range of synthetic relations confirms that the quality of sample relations yielded by systematic sampling is higher than those produced by the traditional simple random sampling.To ensure that sample relations produced by systematic sampling indeed assist in computing more accurate query result sizes, we compare systematic sampling with the most efficient simple random sampling called t_cross using a variety of relation configurations. The results obtained validate that systematic sampling uses the same amount of sampling but still provides more accurate query result sizes than t_cross. Furthermore, the extra sampling cost incurred by the use of systematic sampling pays off in a cheaper query execution cost at run-time.