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

Faster query with a simpler plan by joining with the CTE instead of making IN query #113

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

ddorian
Copy link
Contributor

@ddorian ddorian commented Sep 9, 2023

I set a benchmark doing 200+ updates/second on the queue (using the current behaviour), and ran both queries 1 after the other in a separate session to get their plans. My change removes the HashAggregate. The same plan was with LIMIT 10.

Using PostgreSQL 15.4 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit.

limit_1_before.sql.txt
limit_1_after.sql.txt

The limit 10 was done with a bigger queue doing 40 read/s of batch_size=100.

limit_10.sql.txt

@ddorian ddorian marked this pull request as ready for review September 9, 2023 13:43
@ChuckHend
Copy link
Member

Thanks @ddorian - I'll take a look in next couple days so we can keep this moving forward.

Copy link
Member

@ChuckHend ChuckHend left a comment

Choose a reason for hiding this comment

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

👍

@ChuckHend
Copy link
Member

@ddorian , can you bump the version in ./core/Cargo.toml? This will get the last CI check to pass and publish the release to that core crate.

@ddorian ddorian requested a review from ChuckHend September 13, 2023 07:30
@ChuckHend ChuckHend merged commit 7ce03aa into tembo-io:main Sep 13, 2023
@ddorian ddorian deleted the better_query branch March 8, 2024 08:26
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.

3 participants