From b68df89c19d7a8a6871114708ad341bc9be2ee8d Mon Sep 17 00:00:00 2001 From: Ivan Kripakov Date: Fri, 14 Jun 2024 16:48:45 +0400 Subject: [PATCH] TRY-321: add indexes to optimize embeddings fetching by subject name --- .../db/changelog/db.changelog-0.2.4.yaml | 21 +++++++++++++++++++ .../db/changelog/db.changelog-master.yaml | 2 ++ .../db/changelog/db.changelog-0.2.4.yaml | 21 +++++++++++++++++++ .../db/changelog/db.changelog-master.yaml | 2 ++ 4 files changed, 46 insertions(+) create mode 100644 java/admin/src/main/resources/db/changelog/db.changelog-0.2.4.yaml create mode 100644 java/api/src/test/resources/db/changelog/db.changelog-0.2.4.yaml diff --git a/java/admin/src/main/resources/db/changelog/db.changelog-0.2.4.yaml b/java/admin/src/main/resources/db/changelog/db.changelog-0.2.4.yaml new file mode 100644 index 0000000000..3d4f91b786 --- /dev/null +++ b/java/admin/src/main/resources/db/changelog/db.changelog-0.2.4.yaml @@ -0,0 +1,21 @@ +databaseChangeLog: + - changeSet: + id: create-indexes-on-embeddings + author: ivan.kripakov@pashapay.az + changes: + - createIndex: + tableName: embeddings + columns: + - column: + name: subject_id + indexName: embeddings_subject_id_idx + - changeSet: + id: create-index-on-image-attributes + author: ivan.kripakov@pashapay.az + changes: + - createIndex: + tableName: image_attributes + columns: + - column: + name: image_id + indexName: image_attributes_image_id_idx diff --git a/java/admin/src/main/resources/db/changelog/db.changelog-master.yaml b/java/admin/src/main/resources/db/changelog/db.changelog-master.yaml index fbd6fa2838..d8fbff5b21 100644 --- a/java/admin/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/java/admin/src/main/resources/db/changelog/db.changelog-master.yaml @@ -45,3 +45,5 @@ databaseChangeLog: file: db/changelog/db.changelog-0.2.2.yaml - include: file: db/changelog/db.changelog-0.2.3.yaml + - include: + file: db/changelog/db.changelog-0.2.4.yaml diff --git a/java/api/src/test/resources/db/changelog/db.changelog-0.2.4.yaml b/java/api/src/test/resources/db/changelog/db.changelog-0.2.4.yaml new file mode 100644 index 0000000000..3d4f91b786 --- /dev/null +++ b/java/api/src/test/resources/db/changelog/db.changelog-0.2.4.yaml @@ -0,0 +1,21 @@ +databaseChangeLog: + - changeSet: + id: create-indexes-on-embeddings + author: ivan.kripakov@pashapay.az + changes: + - createIndex: + tableName: embeddings + columns: + - column: + name: subject_id + indexName: embeddings_subject_id_idx + - changeSet: + id: create-index-on-image-attributes + author: ivan.kripakov@pashapay.az + changes: + - createIndex: + tableName: image_attributes + columns: + - column: + name: image_id + indexName: image_attributes_image_id_idx diff --git a/java/api/src/test/resources/db/changelog/db.changelog-master.yaml b/java/api/src/test/resources/db/changelog/db.changelog-master.yaml index fbd6fa2838..d8fbff5b21 100644 --- a/java/api/src/test/resources/db/changelog/db.changelog-master.yaml +++ b/java/api/src/test/resources/db/changelog/db.changelog-master.yaml @@ -45,3 +45,5 @@ databaseChangeLog: file: db/changelog/db.changelog-0.2.2.yaml - include: file: db/changelog/db.changelog-0.2.3.yaml + - include: + file: db/changelog/db.changelog-0.2.4.yaml