docs: def add_cache(self, namespace, key, query_hash, length, cache):
          """Add cached values for the specified date range and query"""
          start = 0
          bulk_insert = self.bulk_insert
          cache_len = len(cache)
          row = '(%s,%s,%s,%s,%s,%s)'
          query = 'INSERT INTO gauged_cache ' \
              '(namespace, key, "hash", length, start, value) VALUES '
          execute = self.cursor.execute
          query_hash = self.psycopg2.Binary(query_hash)
          while start < cache_len:
              rows = cache[start:start+bulk_insert]
              params = []
              for timestamp, value in rows:
                  params.extend((namespace, key, query_hash, length,
                                 timestamp, value))
              insert = (row + ',') * (len(rows) - 1) + row
              execute(query + insert, params)
              start += bulk_insert
          self.db.commit()