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

Implement limit support for Bind #1795

Merged
merged 1 commit into from
Feb 12, 2025
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
4 changes: 4 additions & 0 deletions src/engine/Bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ size_t Bind::getCostEstimate() {
return _subtree->getCostEstimate() + _subtree->getSizeEstimate();
}

// We delegate the limit to the child operation, so we always support it.
bool Bind::supportsLimit() const { return true; }

float Bind::getMultiplicity(size_t col) {
// this is the newly added column
if (col == getResultWidth() - 1) {
Expand Down Expand Up @@ -93,6 +96,7 @@ IdTable Bind::cloneSubView(const IdTable& idTable,

// _____________________________________________________________________________
ProtoResult Bind::computeResult(bool requestLaziness) {
_subtree->setLimit(getLimit());
LOG(DEBUG) << "Get input to BIND operation..." << std::endl;
std::shared_ptr<const Result> subRes = _subtree->getResult(requestLaziness);
LOG(DEBUG) << "Got input to Bind operation." << std::endl;
Expand Down
1 change: 1 addition & 0 deletions src/engine/Bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Bind : public Operation {
[[nodiscard]] size_t getResultWidth() const override;
std::vector<QueryExecutionTree*> getChildren() override;
size_t getCostEstimate() override;
bool supportsLimit() const override;

private:
uint64_t getSizeEstimateBeforeLimit() override;
Expand Down
Loading