• Andreas Brandl's avatar
    Implement TablesampleCountStrategy. · 3a7d9b4b
    Andreas Brandl authored
    A tablesample count executes in two phases:
    * Estimate table sizes based on reltuples.
    * Based on the estimate:
      * If the table is considered 'small', execute an exact relation count.
      * Otherwise, count on a sample of the table using TABLESAMPLE.
    
    The size of the sample is chosen in a way that we always roughly scan
    the same amount of rows (see TABLESAMPLE_ROW_TARGET).
    3a7d9b4b
count_spec.rb 5.36 KB