original_string: private function findSegmentArchives($numericTables)
      {
          if (!is_null($this->segmentArchiveIds) || empty($numericTables)) {
              return;
          }
  
          foreach ($numericTables as $table) {
              $tableDate = ArchiveTableCreator::getDateFromTableName($table);
  
              $maxIdArchive = Db::fetchOne("SELECT MAX(idarchive) FROM $table");
  
              $sql = "SELECT idarchive FROM $table
                       WHERE name != 'done'
                         AND name LIKE 'done_%.%'
                         AND idarchive >= ?
                         AND idarchive < ?";
  
              if (is_null($this->segmentArchiveIds)) {
                  $this->segmentArchiveIds = array();
              }
  
              $this->segmentArchiveIds[$tableDate] = array();
              foreach (Db::segmentedFetchAll($sql, 0, $maxIdArchive, self::$selectSegmentSize) as $row) {
                  $this->segmentArchiveIds[$tableDate][] = $row['idarchive'];
              }
          }
      }
code: private function findSegmentArchives($numericTables)
      {
          if (!is_null($this->segmentArchiveIds) || empty($numericTables)) {
              return;
          }
  
          foreach ($numericTables as $table) {
              $tableDate = ArchiveTableCreator::getDateFromTableName($table);
  
              $maxIdArchive = Db::fetchOne("SELECT MAX(idarchive) FROM $table");
  
              $sql = "SELECT idarchive FROM $table
                       WHERE name != 'done'
                         AND name LIKE 'done_%.%'
                         AND idarchive >= ?
                         AND idarchive < ?";
  
              if (is_null($this->segmentArchiveIds)) {
                  $this->segmentArchiveIds = array();
              }
  
              $this->segmentArchiveIds[$tableDate] = array();
              foreach (Db::segmentedFetchAll($sql, 0, $maxIdArchive, self::$selectSegmentSize) as $row) {
                  $this->segmentArchiveIds[$tableDate][] = $row['idarchive'];
              }
          }
      }
code_tokens: private function findSegmentArchives ( $ numericTables ) { if ( ! is_null ( $ this -> segmentArchiveIds ) || empty ( $ numericTables ) ) { return ; } foreach ( $ numericTables as $ table ) { $ tableDate = ArchiveTableCreator :: getDateFromTableName ( $ table ) ; $ maxIdArchive = Db :: fetchOne ( "SELECT MAX(idarchive) FROM $table" ) ; $ sql = "SELECT idarchive FROM $table
                       WHERE name != 'done'
                         AND name LIKE 'done_%.%'
                         AND idarchive >= ?
                         AND idarchive < ?" ; if ( is_null ( $ this -> segmentArchiveIds ) ) { $ this -> segmentArchiveIds = array ( ) ; } $ this -> segmentArchiveIds [ $ tableDate ] = array ( ) ; foreach ( Db :: segmentedFetchAll ( $ sql , 0 , $ maxIdArchive , self :: $ selectSegmentSize ) as $ row ) { $ this -> segmentArchiveIds [ $ tableDate ] [ ] = $ row [ 'idarchive' ] ; } } }
docstring: If we're going to keep segmented reports, we need to know which archives are
  for segments. This info is only in the numeric tables, so we must query them.
docstring_tokens: If we re going to keep segmented reports we need to know which archives are for segments . This info is only in the numeric tables so we must query them .