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(postgres): add postgres query config + db query optimizations #320

Merged
merged 4 commits into from
May 15, 2024

Conversation

guergabo
Copy link
Contributor

@guergabo guergabo commented May 15, 2024

Changes

  1. Raw query flag for postgres connection.
  2. Less frequent ticks for background jobs as default to not overload the database.
  3. Larger transaction timeouts as default to not quit too soon.
  4. Optimize queries by conditionally preparing statements for postgres aio store.

Copy link

codecov bot commented May 15, 2024

Codecov Report

Attention: Patch coverage is 32.96296% with 181 lines in your changes are missing coverage. Please review.

Project coverage is 55.34%. Comparing base (cc44852) to head (76da7f7).

Files Patch % Lines
...rnal/app/subsystems/aio/store/postgres/postgres.go 0.00% 137 Missing ⚠️
internal/app/subsystems/aio/store/sqlite/sqlite.go 66.91% 22 Missing and 22 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
- Coverage   57.82%   55.34%   -2.48%     
==========================================
  Files         113      113              
  Lines        9794     9885      +91     
==========================================
- Hits         5663     5471     -192     
- Misses       3771     4052     +281     
- Partials      360      362       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@guergabo guergabo requested a review from dfarr May 15, 2024 21:11
@guergabo guergabo self-assigned this May 15, 2024
@guergabo guergabo added the enhancement New feature or request label May 15, 2024
@guergabo guergabo changed the title feat(postgres): add query + tick fixes feat(postgres): add postgres query config + db query optimizations May 15, 2024
@guergabo guergabo merged commit 7a52a56 into main May 15, 2024
3 of 5 checks passed
@guergabo guergabo deleted the postgres-query branch May 15, 2024 23:16
guergabo added a commit that referenced this pull request May 15, 2024
) (#321)

* feat(postgres): add query + tick fixes

* feat(postgres): conditional prepare statement

* fix(postgres): Ranging over a map is non deterministic

* Lazily define prepared statement

---------

Co-authored-by: Gabriel Guerra <[email protected]>
Co-authored-by: David Farr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants