Skip to content

Commit bd38a40

Browse files
committed
Add some sql indices
1 parent 59a9abd commit bd38a40

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ create index offers_name_description_idx on offers
130130
using gin (to_tsvector('russian', name || ' ' || description));
131131
```
132132

133+
Indices for internal needs:
134+
135+
```sql
136+
create index photos_offer_id on offer_photos (offer_id);
137+
138+
create index offers_status_idx on offers (status);
139+
```
140+
133141
### REST API
134142

135143
#### Authorization
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
create index photos_offer_id on offer_photos (offer_id);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
create index offers_status_idx on offers (status);

service/src/main/scala/com/github/mmvpm/service/dao/offer/OfferDaoPostgresql.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class OfferDaoPostgresql[F[_]: MonadCancelThrow](implicit val tr: Transactor[F])
245245
select id, url, blob, telegram_id
246246
from photos
247247
join offer_photos op on photos.id = op.photo_id
248-
where op.offer_id = $offerId
248+
where offer_id = $offerId
249249
"""
250250
.query[PhotosEntry]
251251
.to[List]

0 commit comments

Comments
 (0)