Add GIN indexes for attributes which used to search.
This commit is contained in:
@@ -16,6 +16,10 @@ defmodule DecentralisedBookIndex.Metadata.Author do
|
||||
postgres do
|
||||
table "authors"
|
||||
repo DecentralisedBookIndex.Repo
|
||||
|
||||
custom_indexes do
|
||||
index "name gin_trgm_ops", name: "author_name_gin_index", using: "GIN"
|
||||
end
|
||||
end
|
||||
|
||||
actions do
|
||||
|
||||
@@ -16,6 +16,10 @@ defmodule DecentralisedBookIndex.Metadata.Book do
|
||||
postgres do
|
||||
table "books"
|
||||
repo DecentralisedBookIndex.Repo
|
||||
|
||||
custom_indexes do
|
||||
index "title gin_trgm_ops", name: "book_title_gin_index", using: "GIN"
|
||||
end
|
||||
end
|
||||
|
||||
actions do
|
||||
|
||||
@@ -19,6 +19,11 @@ defmodule DecentralisedBookIndex.Metadata.BookId do
|
||||
references do
|
||||
reference :book, index?: true, on_delete: :delete
|
||||
end
|
||||
|
||||
custom_indexes do
|
||||
index "type gin_trgm_ops", name: "book_id_type_gin_index", using: "GIN"
|
||||
index "bid gin_trgm_ops", name: "book_id_bid_gin_index", using: "GIN"
|
||||
end
|
||||
end
|
||||
|
||||
actions do
|
||||
|
||||
@@ -10,6 +10,10 @@ defmodule DecentralisedBookIndex.Metadata.DBIServer do
|
||||
postgres do
|
||||
table "dbi_servers"
|
||||
repo DecentralisedBookIndex.Repo
|
||||
|
||||
custom_indexes do
|
||||
index "name gin_trgm_ops", name: "server_name_gin_index", using: "GIN"
|
||||
end
|
||||
end
|
||||
|
||||
actions do
|
||||
|
||||
@@ -16,6 +16,10 @@ defmodule DecentralisedBookIndex.Metadata.Publisher do
|
||||
postgres do
|
||||
table "publishers"
|
||||
repo DecentralisedBookIndex.Repo
|
||||
|
||||
custom_indexes do
|
||||
index "name gin_trgm_ops", name: "publisher_name_gin_index", using: "GIN"
|
||||
end
|
||||
end
|
||||
|
||||
actions do
|
||||
|
||||
Reference in New Issue
Block a user