Skip to content

Commit

Permalink
Add some sql indices
Browse files Browse the repository at this point in the history
  • Loading branch information
mmvpm committed May 10, 2024
1 parent 59a9abd commit bd38a40
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ create index offers_name_description_idx on offers
using gin (to_tsvector('russian', name || ' ' || description));
```

Indices for internal needs:

```sql
create index photos_offer_id on offer_photos (offer_id);

create index offers_status_idx on offers (status);
```

### REST API

#### Authorization
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create index photos_offer_id on offer_photos (offer_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create index offers_status_idx on offers (status);
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class OfferDaoPostgresql[F[_]: MonadCancelThrow](implicit val tr: Transactor[F])
select id, url, blob, telegram_id
from photos
join offer_photos op on photos.id = op.photo_id
where op.offer_id = $offerId
where offer_id = $offerId
"""
.query[PhotosEntry]
.to[List]
Expand Down

0 comments on commit bd38a40

Please sign in to comment.