code: public void addPrimaryKeysIfSourced() {
          Column[] primaryKeyColumns = _table.getPrimaryKeys();
          if (primaryKeyColumns == null || primaryKeyColumns.length == 0) {
              logger.info("No primary keys defined for table {}, not pre-selecting primary keys", _table.getName());
              return;
          }
  
          final AnalysisJob analysisJob = _publishers.getAnalysisJob();
          final Collection<InputColumn<?>> sourceInputColumns = analysisJob.getSourceColumns();
          final List<Column> sourceColumns = CollectionUtils.map(sourceInputColumns, new Func<InputColumn<?>, Column>() {
              @Override
              public Column eval(InputColumn<?> inputColumn) {
                  return inputColumn.getPhysicalColumn();
              }
          });
  
          for (Column primaryKeyColumn : primaryKeyColumns) {
              if (!sourceColumns.contains(primaryKeyColumn)) {
                  logger.info("Primary key column {} not added to source columns, not pre-selecting primary keys");
                  return;
              }
          }
  
          addPhysicalColumns(primaryKeyColumns);
      }
docs: Inspects the row processed tables primary keys. If all primary keys are
  in the source columns of the AnalysisJob, they will be added to the
  physically queried columns.
  
  Adding the primary keys to the query is a trade-off: It helps a lot in
  making eg. annotated rows referenceable to the source table, but it may
  also potentially make the job heavier to execute since a lot of (unique)
  values will be retrieved.