-
Notifications
You must be signed in to change notification settings - Fork 78
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
Return bools from archive/delete_batch #95
Return bools from archive/delete_batch #95
Conversation
First, thank you for contributing!
I think its ok to overload the functions so that batch and single operations use the same API. Underneath though, do you know how much perf difference there will be for treating the single operations the same as a batch? e.g. a batch of size 1 vs a single? I have not benchmarked it yet. |
Excellent question. Let me see if I can run one with pgbench and I'll check back in. Another thing to try I suppose is to add a quick benchmark test (based on https://doc.rust-lang.org/unstable-book/library-features/test.html) in another PR, and then we can compare them that way too. |
So I wrote a small script that looks like
and ran pgbench with that. The results are below. There doesn't seem to be much of a difference, but I am not an expert of pgbench or Postgres benchmarks. Any suggestions? Thanks! Current
This PR
|
There is no Update: I don't see how it can work with |
The
|
🤔 it's unlikely, but archive_batch also has to go through some string construction and manipulation which could add a slight latency. Let me try to replace |
I tried explain analyze just to see what happens when using
What was kind of interesting is that
|
Will need to bump core/Cargo.toml and ./Cargo.toml versions. Also add an empty migration script for this version. |
👋 @ChuckHend. Bumped minor versions and added empty migration scripts. I added 0.21 to 0.22 too since we are now at 0.22. Is that correct? Thanks! |
Yes! Good call. It's easy to forget those. Wish we had CI checks for them. |
I think the migration script will need some handing in it. Upgrading an existing install of 0.21.0 to 0.22.0, i think fails because we need to drop the existing functions first, since we've changed the return signature. Install 0.21.0
Then checkout this PR and update the extension.
That fails, because I think the extension has to be completely dropped when the signature changes. Maybe pgrx can be configured to do this? However, if we completely drop the extension (which drops all the objects), it works as I'd expect it to.
So I don't think there's anything wrong with the code, just the migration. |
🤔 I spent a bunch of time trying to get this to work before realizing it doesn't really work like I thought it would. This issue pgcentralfoundation/pgrx#121 seems to indicate that |
@@ -157,7 +157,7 @@ async fn test_ext_send_read_delete() { | |||
.expect("failed to delete"); | |||
assert!(deleted); | |||
|
|||
// try to delete a message that doesnt exist | |||
// try to delete a message that doesn't exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is triggering CI to fail on pgmq-rs. only because its telling us that the version in pgmq-rs/Cargo.toml already exists in crates.io. We can ignore that CI error.
Closes #89.
This is an attempt at resolving #89. I also refactored archive in terms of archive_batch. Please let me know if you want me to revert that part.
It has been quite a while since I have written any Rust. I get the feeling I should be doing more
map
ing andand_then
ing and using lessmut
🙂Before
After