Skip to content

Create index on proposal.grade#108

Merged
monodera merged 2 commits into
mainfrom
tickets/OBSPROC-117
Apr 1, 2025
Merged

Create index on proposal.grade#108
monodera merged 2 commits into
mainfrom
tickets/OBSPROC-117

Conversation

@monodera
Copy link
Copy Markdown
Contributor

@monodera monodera commented Apr 1, 2025

This PR does add an index on proposal.grade hoping to make query faster with filtering by the proposal grade. After updating the db with this change and analyze target, the query becomes reasonably fast. I'm not sure if this is the right way, but adding the index makes sense.


"""

import sqlalchemy as sa

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'sqlalchemy' (import-error)

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)

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

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'

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

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

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

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

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

Missing function docstring
# ### end Alembic commands ###


def downgrade():

Check warning

Code scanning / Pylint (reported by Codacy)

Missing function docstring

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

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

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

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

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

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

Missing function or method docstring
# ### end Alembic commands ###


def downgrade():

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing function or method docstring

Missing function or method docstring
@monodera monodera merged commit e78ebe0 into main Apr 1, 2025
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.

2 participants