A major bottleneck in implementing sampling as a primitive relational operation is the ine ciency ofsampling the output of a query. It is not even known whether it is possible to generate a sample of a join tree without rst evaluating the join tree completely. We undertake a detailed study of this problem and attempt to analyze it in a variety of settings. We present theoretical results explaining the di culty of this problem and setting limits on the e ciency that can be achieved. Based on new insights into the interaction between join and sampling, we develop join sampling techniques for the settings where our negative results do not apply. Our new sampling algorithms are signi cantly more e cient than those known earlier. We present experimental evaluation of our techniques on Microsoft's SQL Server 7.0.
Surajit Chaudhuri, Rajeev Motwani, Vivek R. Narasa