Histogram Techniques for Cost Estimation in Query Optimization