You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tablesample_count_strategy.rb
    path of file: ./repos/gitlabhq/lib/gitlab/database/count
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module Database
    module Count
      # A tablesample count executes in two 
    
        def perform_count(model, estimate)
          # If we estimate 0, we may not have statistics at all. Don't use them.
          return unless estimate && estimate > 0

          if estimate < EXACT_COUNT_THRESHOLD
            # The table is considered small, the assumption here is that
            # the exact count will be fast anyways.
            model.count
          else
            # The table is considered large, let's only count on a sample.
            tablesample_count(model, estimate)
          end