docs: private long getScanStartTimeSeconds() {
      // Begin with the raw query start time.
      long start = getStartTime();
  
      // Convert to seconds if we have a query in ms.
      if ((start & Const.SECOND_MASK) != 0L) {
        start /= 1000L;
      }
      
      // if we have a rollup query, we have different row key start times so find
      // the base time from which we need to search
      if (rollup_query != null) {
        long base_time = RollupUtils.getRollupBasetime(start, 
            rollup_query.getRollupInterval());
        if (rate) {
          // scan one row back so we can get the first rate value.
          base_time = RollupUtils.getRollupBasetime(base_time - 1, 
              rollup_query.getRollupInterval());
        }
        return base_time;
      }
  
      // First, we align the start timestamp to its representative value for the
      // interval in which it appears, if downsampling.
      long interval_aligned_ts = start;
      if (downsampler != null && downsampler.getInterval() > 0) {
        // Downsampling enabled.
        // TODO - calendar interval
        final long interval_offset = (1000L * start) % downsampler.getInterval();
        interval_aligned_ts -= interval_offset / 1000L;
      }
  
      // Then snap that timestamp back to its representative value for the
      // timespan in which it appears.
      final long timespan_offset = interval_aligned_ts % Const.MAX_TIMESPAN;
      final long timespan_aligned_ts = interval_aligned_ts - timespan_offset;
  
      // Don't return negative numbers.
      return timespan_aligned_ts > 0L ? timespan_aligned_ts : 0L;
    }