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

Predicate Pushdown for video table #273

Merged
merged 24 commits into from
Jul 31, 2022

Conversation

gaurav274
Copy link
Member

  1. Push down the predicate on the video table to avoid decoding all the frames.
  2. Supports simple range-based and equality-based predicates.

@gaurav274 gaurav274 requested a review from xzdandy July 27, 2022 21:51
# System only supports pushing basic range predicates on id
video_alias = lget.video.alias
col_alias = f"{video_alias}.id"
pushdown_pred, unsupported_pred = extract_pushdown_predicate(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we try avoiding doing the same computation in rule check and apply?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of it. But, the only way to avoid it is by keeping the state across check and apply which might creep in bugs.

Copy link
Member Author

@gaurav274 gaurav274 Jul 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, do you have any thoughts on it? I might be doing the same in future rules as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can either keep the state in rule or in optimizer context. I think both we need to clean up afterwards. To enforce the cleaning up, we may can implement a step in the base class, though not sure it is a good idea or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the optimizer context idea. But it is too much engineering for now. I do not think the computation is expensive enough for us to spend time on this optimization.

RuntimeError: Invalid expression

Example:
extract_range_from_comparison_expr(id < 10, 0, inf): True, [(0,9)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we input inf?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inf is just an example. For actual code, we would always know the upper and lower bound. The ultimate goal is to get it from catalog and pass it down the pipeline.

Copy link
Collaborator

@xzdandy xzdandy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM

@gaurav274 gaurav274 merged commit 02b0cae into georgia-tech-db:master Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants