Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable large lists scan to copy multi-pages sequentially #1143

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/include/storage/store/node_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class NodeTable {
void deleteNode(node_offset_t nodeOffset, ValueVector* primaryKeyVector, uint32_t pos) const;

private:
// TODO(Guodong): Consider moving statistics and deleted ids to catalog.
NodesStatisticsAndDeletedIDs* nodesStatisticsAndDeletedIDs;
// This is for properties.
vector<unique_ptr<Column>> propertyColumns;
Expand Down
11 changes: 5 additions & 6 deletions src/storage/storage_structure/lists/lists.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ unique_ptr<vector<nodeID_t>> AdjLists::readAdjacencyListOfNode(

void AdjLists::readFromLargeList(
const shared_ptr<ValueVector>& valueVector, ListHandle& listHandle) {
uint64_t nextPartBeginElemOffset =
uint32_t nextPartBeginElemOffset =
listHandle.hasValidRangeToRead() ? listHandle.getEndElemOffset() : 0;
auto pageCursor =
PageUtils::getPageElementCursorForPos(nextPartBeginElemOffset, numElementsPerPage);
Expand All @@ -260,17 +260,16 @@ void AdjLists::readFromLargeList(
// page that's being read (nextPartBeginElemOffset above should be set to the beginning of the
// next page. Note that because of case (ii), this computation guarantees that what we read fits
// into a single page. That's why we can call copyFromAPage.
auto numValuesToCopy =
min((uint32_t)(listHandle.getNumValuesInList() - nextPartBeginElemOffset),
numElementsPerPage - (uint32_t)(nextPartBeginElemOffset % numElementsPerPage));
auto numValuesToCopy = min(listHandle.getNumValuesInList() - nextPartBeginElemOffset,
(uint32_t)DEFAULT_VECTOR_CAPACITY);
valueVector->state->initOriginalAndSelectedSize(numValuesToCopy);
listHandle.setRangeToRead(nextPartBeginElemOffset, numValuesToCopy);
// map logical pageIdx to physical pageIdx
auto physicalPageId = listHandle.mapper(pageCursor.pageIdx);
// See comments for AdjLists::readFromSmallList.
auto dummyReadOnlyTrx = Transaction::getDummyReadOnlyTrx();
readNodeIDsFromAPageBySequentialCopy(dummyReadOnlyTrx.get(), valueVector, 0, physicalPageId,
pageCursor.elemPosInPage, numValuesToCopy, nodeIDCompressionScheme, true /*isAdjLists*/);
readNodeIDsBySequentialCopy(dummyReadOnlyTrx.get(), valueVector, pageCursor, listHandle.mapper,
nodeIDCompressionScheme, true /*isAdjLists*/);
}

// Note: This function sets the original and selected size of the DataChunk into which it will
Expand Down