m_ee.loadTable(WAREHOUSE_TABLEID, m_warehousedata, 0, 0, 0, false, false, Long.MAX_VALUE);
assertEquals(m_tableSize, m_ee.serializeTable(WAREHOUSE_TABLEID).getRowCount());
System.out.println("Rows loaded to table "+m_ee.serializeTable(WAREHOUSE_TABLEID).getRowCount());
Statement selectStmt = m_testProc.getStatements().getIgnoreCase("warehouse_select");
PlanFragment selectBottomFrag = null;
// delete 5000 records
// I have no idea what's going on here, and just copy code from the above methods
int i = 0;
// this kinda assumes the right order
for (PlanFragment f : selectStmt.getFragments()) {
if (i != 0) selectBottomFrag = f;
i++;
}
// populate plan cache
ActivePlanRepository.clear();
ActivePlanRepository.addFragmentForTest(
CatalogUtil.getUniqueIdForFragment(selectBottomFrag),
Encoder.decodeBase64AndDecompressToBytes(selectBottomFrag.getPlannodetree()),
selectStmt.getSqltext());
ParameterSet params = ParameterSet.emptyParameterSet();
m_ee.executePlanFragments(
1,
new long[] { CatalogUtil.getUniqueIdForFragment(selectBottomFrag) },
null,
new ParameterSet[] { params },
new String[] { selectStmt.getSqltext() },
3, 3, 2, 42, Long.MAX_VALUE);
// Like many fully successful operations, a single row fetch counts as 2 logical row operations,
// one for locating the row and one for retrieving it.
assertEquals(2, m_ee.m_callsFromEE);
assertEquals(m_longOpthreshold * m_ee.m_callsFromEE, m_ee.m_lastTuplesAccessed);
assertTrue(900000 < m_ee.m_currMemoryInBytes);
assertTrue(1100000 > m_ee.m_currMemoryInBytes);
assertTrue(900000 < m_ee.m_peakMemoryInBytes);
assertTrue(1100000 > m_ee.m_peakMemoryInBytes);
assertTrue(m_ee.m_peakMemoryInBytes >= m_ee.m_currMemoryInBytes);
long previousPeakMemory = m_ee.m_peakMemoryInBytes;
Statement deleteStmt = m_testProc.getStatements().getIgnoreCase("warehouse_del_half");
assertNotNull(deleteStmt);
PlanFragment deleteBottomFrag = null;
int j = 0;
// this kinda assumes the right order
for (PlanFragment f : deleteStmt.getFragments()) {
if (j != 0) deleteBottomFrag = f;
j++;
}
// populate plan cache
ActivePlanRepository.clear();
ActivePlanRepository.addFragmentForTest(
CatalogUtil.getUniqueIdForFragment(deleteBottomFrag),
Encoder.decodeBase64AndDecompressToBytes(deleteBottomFrag.getPlannodetree()),
deleteStmt.getSqltext());
params = ParameterSet.emptyParameterSet();
m_ee.executePlanFragments(
1,
new long[] { CatalogUtil.getUniqueIdForFragment(deleteBottomFrag) },