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

Optimize pgsql queries without parameters #5889

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

derrabus
Copy link
Member

Q A
Type improvement
Fixed issues Follow-up to #5880, replaces #5887

Summary

This change should speed up pgsql queries without parameters a little.

Co-authored-by: Max <49632507+maxm86545@users.noreply.github.com>
@derrabus derrabus force-pushed the improvement/optimize-pg-query branch from c19f962 to 121cc38 Compare January 31, 2023 23:13
@derrabus
Copy link
Member Author

@maxm86545 I tagged you as co-author because my PR somewhat builds on your code in #5887.

@derrabus derrabus added this to the 3.6.0 milestone Jan 31, 2023
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

Approving in case the answer to my question is "yes"

}

$result = @pg_get_result($this->connection);
assert($result !== false);
Copy link
Member

Choose a reason for hiding this comment

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

What should happen when a query returns 0 records? Do we still get a PgSql\Result instance?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. An empty result is still a result.

Also, that case is really well covered by functional tests. 😀

@derrabus derrabus merged commit f73e964 into 3.6.x Feb 1, 2023
@derrabus derrabus deleted the improvement/optimize-pg-query branch February 1, 2023 08:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants