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

feat: Support prefetch in index lookup join #12611

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiaoxmeng
Copy link
Contributor

Summary:
This PR adds prefetch for index join with query config. The index join operator can prefetch up to the
configured prefetch limit to enable: (1) parallel prefetches at backend for parallel execution (1-1) in case
of multiple backend shards or (1-2) enable backend to batch multiple requests to improve throughput;
(2) pipeline the table scan and index lookup execution in the same driver pipeline. The table scan is sync
executed while index lookup is async. This achieve pipelining without relying exchange which might cause
non-deterministic execution and Meta internal use case needs deterministic execution for checkpointing.
With Meta internal testing, this can achieve 2x throughput improvement (measured in rows per second)
with 33% memory overhead with up to 4 batches prefetch.

The follow is to add memory based prefetch throttling to integrate with Meta internal
ML use case and memory pool wiring to ease performance (memory overhead) analysis

Differential Revision: D70909786

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 11, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70909786

Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 71a1913
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67d12f53d5d6b3000831a16c

xiaoxmeng added a commit to xiaoxmeng/velox that referenced this pull request Mar 12, 2025
Summary:

This PR adds prefetch for index join with query config. The index join operator can prefetch up to the
configured prefetch limit to enable: (1) parallel prefetches  at backend for parallel execution (1-1) in case
of multiple backend shards or (1-2) enable backend to batch multiple requests to improve throughput;
(2) pipeline the table scan and index lookup execution in the same driver pipeline. The table scan is sync
executed while index lookup is async. This achieve pipelining without relying exchange which might cause
non-deterministic execution and Meta internal use case needs deterministic execution for checkpointing.
With Meta internal testing, this can achieve 2x throughput improvement (measured in rows per second)
with 33% memory overhead with up to 4 batches prefetch.

The follow is to add memory based prefetch throttling to integrate with Meta internal
ML use case and memory pool wiring to ease performance (memory overhead) analysis

Reviewed By: wenqiwooo

Differential Revision: D70909786
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70909786

xiaoxmeng added a commit to xiaoxmeng/velox that referenced this pull request Mar 12, 2025
Summary:

This PR adds prefetch for index join with query config. The index join operator can prefetch up to the
configured prefetch limit to enable: (1) parallel prefetches  at backend for parallel execution (1-1) in case
of multiple backend shards or (1-2) enable backend to batch multiple requests to improve throughput;
(2) pipeline the table scan and index lookup execution in the same driver pipeline. The table scan is sync
executed while index lookup is async. This achieve pipelining without relying exchange which might cause
non-deterministic execution and Meta internal use case needs deterministic execution for checkpointing.
With Meta internal testing, this can achieve 2x throughput improvement (measured in rows per second)
with 33% memory overhead with up to 4 batches prefetch.

The follow is to add memory based prefetch throttling to integrate with Meta internal
ML use case and memory pool wiring to ease performance (memory overhead) analysis

Reviewed By: wenqiwooo

Differential Revision: D70909786
Summary:

This PR adds prefetch for index join with query config. The index join operator can prefetch up to the
configured prefetch limit to enable: (1) parallel prefetches  at backend for parallel execution (1-1) in case
of multiple backend shards or (1-2) enable backend to batch multiple requests to improve throughput;
(2) pipeline the table scan and index lookup execution in the same driver pipeline. The table scan is sync
executed while index lookup is async. This achieve pipelining without relying exchange which might cause
non-deterministic execution and Meta internal use case needs deterministic execution for checkpointing.
With Meta internal testing, this can achieve 2x throughput improvement (measured in rows per second)
with 33% memory overhead with up to 4 batches prefetch.

The follow is to add memory based prefetch throttling to integrate with Meta internal
ML use case and memory pool wiring to ease performance (memory overhead) analysis

Reviewed By: wenqiwooo

Differential Revision: D70909786
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D70909786

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants