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

use table stats to decide which side of NL to broadcast #2780

Merged
merged 1 commit into from
Oct 22, 2015

Conversation

mfussenegger
Copy link
Member

The smaller table should be broadcasted. This can significantly speed up query
execution if the size difference of the tables is very big.

In a simple test it reduced the time for a query from 125 sec to 0.8 sec

assertThat(statsService.numDocs(new TableIdent("foo", "bar")), is(2L)); // first call triggers request
assertThat(statsService.numDocs(new TableIdent("foo", "bar")), is(2L)); // second call hits cache
int slept = 0;
while (numRequests.get() < 2 && slept < 1000) {
Copy link
Member

Choose a reason for hiding this comment

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

won't be 100 enough?

Copy link
Member Author

Choose a reason for hiding this comment

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

should be, the slept < 1000 is just a failsafe in case numRequests never increases (which should after 100 ms are elapsed)

Copy link
Member

Choose a reason for hiding this comment

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

ah got it

@seut
Copy link
Member

seut commented Oct 22, 2015

otherwise ack

The smaller table should be broadcasted. This can
significantly speed up query execution if the size
difference of the tables is very big.

In a simple test it reduced the time for a query from 125
sec to 0.8 sec
@mfussenegger mfussenegger merged commit 32f4fcc into filter-joins Oct 22, 2015
@mfussenegger mfussenegger deleted the j/table-stats branch October 22, 2015 12:00
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