Class SampleCoexpressionMatrixLoadSqlTest

java.lang.Object
ubic.gemma.core.util.test.BaseTest5
ubic.gemma.core.util.test.BaseDatabaseTest5
ubic.gemma.persistence.service.analysis.expression.sampleCoexpression.SampleCoexpressionMatrixLoadSqlTest

@ContextConfiguration public class SampleCoexpressionMatrixLoadSqlTest extends BaseDatabaseTest5
Pins the SQL Hibernate issues to load a SampleCoexpressionMatrix by id: the statement that selects the blob joins nothing.

A joined to-many multiplies result rows, and every row carries every selected column. While bioAssayDimension was @Fetch(JOIN), the by-id loader was

select ..., scm.COEXPRESSION_MATRIX from SAMPLE_COEXPRESSION_MATRIX scm
  join BIO_ASSAY_DIMENSION bad ... left join BIO_ASSAY_DIMENSIONS2BIO_ASSAYS ... left join BIO_ASSAY ...
  where scm.ID in (?, ...)
because BioAssayDimension.bioAssays is EAGER and rides along on the join. That is one row per bioassay, each with the whole n-squared LONGBLOB: for 1,090 samples, 1,090 copies of a 9.5 MB matrix on the wire to read one. The storage engine reads the matrix row once, so table I/O counters show a single fetch.

The assertion is on the statement and not on a row count so that it needs no fixture; the row multiplication follows from the join.

  • Constructor Details

    • SampleCoexpressionMatrixLoadSqlTest

      public SampleCoexpressionMatrixLoadSqlTest()
  • Method Details

    • theStatementThatSelectsTheBlobJoinsNothing

      @Test public void theStatementThatSelectsTheBlobJoinsNothing()