Create index on proposal.grade#108
Conversation
|
|
||
| """ | ||
|
|
||
| import sqlalchemy as sa |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'sqlalchemy' (import-error)
| #!/usr/bin/env python3 | ||
|
|
||
| from sqlalchemy import Boolean, Column, DateTime, Float, ForeignKey, Integer, String | ||
| from sqlalchemy import ( |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'sqlalchemy' (import-error)
| @@ -0,0 +1,83 @@ | |||
| """create index on proposal.grade | |||
Check warning
Code scanning / Pylint (reported by Codacy)
Module name "20250331-121154_5b40ed8dcd48_create_index_on_proposal_grade" doesn't conform to snake_case naming style
|
|
||
| import sqlalchemy as sa | ||
|
|
||
| from alembic import op |
Check warning
Code scanning / Pylint (reported by Codacy)
No name 'op' in module 'alembic'
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "5b40ed8dcd48" |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "revision" doesn't conform to UPPER_CASE naming style
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "5b40ed8dcd48" | ||
| down_revision = "0b72e62efd44" |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "down_revision" doesn't conform to UPPER_CASE naming style
| # revision identifiers, used by Alembic. | ||
| revision = "5b40ed8dcd48" | ||
| down_revision = "0b72e62efd44" | ||
| branch_labels = None |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "branch_labels" doesn't conform to UPPER_CASE naming style
| revision = "5b40ed8dcd48" | ||
| down_revision = "0b72e62efd44" | ||
| branch_labels = None | ||
| depends_on = None |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "depends_on" doesn't conform to UPPER_CASE naming style
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): |
Check warning
Code scanning / Pylint (reported by Codacy)
Missing function docstring
| @@ -0,0 +1,83 @@ | |||
| """create index on proposal.grade | |||
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Module name "20250331-121154_5b40ed8dcd48_create_index_on_proposal_grade" doesn't conform to snake_case naming style
| from alembic import op | ||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "5b40ed8dcd48" |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Constant name "revision" doesn't conform to UPPER_CASE naming style
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = "5b40ed8dcd48" | ||
| down_revision = "0b72e62efd44" |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Constant name "down_revision" doesn't conform to UPPER_CASE naming style
| # revision identifiers, used by Alembic. | ||
| revision = "5b40ed8dcd48" | ||
| down_revision = "0b72e62efd44" | ||
| branch_labels = None |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Constant name "branch_labels" doesn't conform to UPPER_CASE naming style
| revision = "5b40ed8dcd48" | ||
| down_revision = "0b72e62efd44" | ||
| branch_labels = None | ||
| depends_on = None |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Constant name "depends_on" doesn't conform to UPPER_CASE naming style
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring
| # ### end Alembic commands ### | ||
|
|
||
|
|
||
| def downgrade(): |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing function or method docstring
This PR does add an index on
proposal.gradehoping to make query faster with filtering by the proposal grade. After updating the db with this change andanalyze target, the query becomes reasonably fast. I'm not sure if this is the right way, but adding the index makes sense.