Skip to content

Commit

Permalink
Merge pull request #190 from raphaelrpl/b-1.0
Browse files Browse the repository at this point in the history
✨ Add combined index for STAC
  • Loading branch information
raphaelrpl authored Dec 6, 2022
2 parents f9d03d7 + a8aaeb1 commit 5b85d42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bdc_catalog/alembic/f3112636be24_remove_lccs_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def upgrade():

op.create_index('idx_bdc_items_start_date_desc_id', 'items', [sa.text('start_date DESC'), 'id'], unique=False,
schema='bdc')
op.create_index('idx_bdc_items_start_date_desc_id_is_available', 'items',
[sa.text('start_date DESC'), 'id', 'is_available'], unique=False,
schema='bdc')
op.drop_table('collections_roles', schema='bdc')
op.drop_table('roles', schema='bdc')
# ### end Alembic commands ###
Expand Down Expand Up @@ -73,3 +76,4 @@ def downgrade():
schema='bdc'
)
op.drop_index('idx_bdc_items_start_date_desc_id', table_name='items', schema='bdc')
op.drop_index('idx_bdc_items_start_date_desc_id_is_available', table_name='items', schema='bdc')
1 change: 1 addition & 0 deletions bdc_catalog/models/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class Item(BaseModel):
Index(None, start_date),
Index('idx_bdc_items_start_date_desc', start_date.desc()),
Index(None, start_date.desc(), id),
Index('idx_bdc_items_start_date_desc_id_is_available', start_date.desc(), id, is_available),
Index(None, metadata_),
dict(schema=BDC_CATALOG_SCHEMA),
)
Expand Down

0 comments on commit 5b85d42

Please sign in to comment.