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

api: Grant Indexes #198

Merged
merged 3 commits into from Mar 19, 2024
Merged

api: Grant Indexes #198

merged 3 commits into from Mar 19, 2024

Conversation

R2ZER0
Copy link
Contributor

@R2ZER0 R2ZER0 commented Mar 18, 2024

This PR creates database indexes on the new Grant convenience fields to finish the work of improving API GrantMadeView and GrantReceivedView performance.

@R2ZER0 R2ZER0 marked this pull request as draft March 18, 2024 21:13
@R2ZER0
Copy link
Contributor Author

R2ZER0 commented Mar 18, 2024

It looks like the tests are failing, because the new indexes rely on the btree_gin1 postgres extension. Django tries to create it, but only superusers can create the extension: https://github.com/ThreeSixtyGiving/datastore/actions/runs/8333672434/job/22805632982?pr=198

I guess we'll have to check that we're happy to use it, and then enable the extension in salt config.

Footnotes

  1. https://www.postgresql.org/docs/12/btree-gin.html

@R2ZER0 R2ZER0 requested a review from michaelwood March 18, 2024 21:20
@R2ZER0 R2ZER0 force-pushed the rg/grant-indexes branch 4 times, most recently from cec9126 to 0153b2b Compare March 19, 2024 15:04
So that it can CREATE EXTENSION the btree_gin extension in test
databases.
@michaelwood michaelwood marked this pull request as ready for review March 19, 2024 15:46
@R2ZER0
Copy link
Contributor Author

R2ZER0 commented Mar 19, 2024

I tried fixing the tests by manually installing the extension into the 360givingdatastore test db w/ psql, but Django creates it's own temporary database to run the tests in instead. The only feasibly way I could think of to fix it then was to give the test user superuser so Django can create the extension itsself.

@R2ZER0 R2ZER0 merged commit 43b972b into live Mar 19, 2024
6 checks passed
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