private boolean shouldIndex(SourceState possibleIndex, SourceState other) throws TeiidComponentException, TeiidProcessingException { long size = joinNode.getBatchSize(); long indexSize = possibleIndex.hasBuffer()?possibleIndex.getRowCount():-1; long otherSize = other.hasBuffer()?other.getRowCount():-1; int schemaSize = this.joinNode.getBufferManager().getSchemaSize(other.getSource().getOutputElements()); int toReserve = this.joinNode.getBufferManager().getMaxProcessingSize(); int minSize = toReserve/schemaSize*this.joinNode.getBatchSize(); if (otherSize != -1 && otherSize < this.joinNode.getBatchSize()) { if (other.hasBuffer() && ((other.getRowCount() <= this.joinNode.getBatchSize()) || (possibleIndex.getRowCount() > this.joinNode.getBatchSize() && other.rowCountLE(minSize)))) { return false; //just use a merge join if (toReserve < this.joinNode.getBufferManager().getMaxProcessingSize()) { useIndex = true; } else if (possibleIndex.getRowCount() / this.joinNode.getBatchSize() < preferMemCutoff) { useIndex = true;
private boolean shouldIndex(SourceState possibleIndex, SourceState other) throws TeiidComponentException, TeiidProcessingException { long size = joinNode.getBatchSize(); long indexSize = possibleIndex.hasBuffer()?possibleIndex.getRowCount():-1; long otherSize = other.hasBuffer()?other.getRowCount():-1; int schemaSize = this.joinNode.getBufferManager().getSchemaSize(other.getSource().getOutputElements()); int toReserve = this.joinNode.getBufferManager().getMaxProcessingSize(); int minSize = toReserve/schemaSize*this.joinNode.getBatchSize(); if (otherSize != -1 && otherSize < this.joinNode.getBatchSize()) { if (other.hasBuffer() && ((other.getRowCount() <= this.joinNode.getBatchSize()) || (possibleIndex.getRowCount() > this.joinNode.getBatchSize() && other.rowCountLE(minSize)))) { return false; //just use a merge join if (toReserve < this.joinNode.getBufferManager().getMaxProcessingSize()) { useIndex = true; } else if (possibleIndex.getRowCount() / this.joinNode.getBatchSize() < preferMemCutoff) { useIndex = true;
private boolean shouldIndex(SourceState possibleIndex, SourceState other) throws TeiidComponentException, TeiidProcessingException { long size = joinNode.getBatchSize(); long indexSize = possibleIndex.hasBuffer()?possibleIndex.getRowCount():-1; long otherSize = other.hasBuffer()?other.getRowCount():-1; int schemaSize = this.joinNode.getBufferManager().getSchemaSize(other.getSource().getOutputElements()); int toReserve = this.joinNode.getBufferManager().getMaxProcessingSize(); int minSize = toReserve/schemaSize*this.joinNode.getBatchSize(); if (otherSize != -1 && otherSize < this.joinNode.getBatchSize()) { if (other.hasBuffer() && ((other.getRowCount() <= this.joinNode.getBatchSize()) || (possibleIndex.getRowCount() > this.joinNode.getBatchSize() && other.rowCountLE(minSize)))) { return false; //just use a merge join if (toReserve < this.joinNode.getBufferManager().getMaxProcessingSize()) { useIndex = true; } else if (possibleIndex.getRowCount() / this.joinNode.getBatchSize() < preferMemCutoff) { useIndex = true;