feat(member): resolve custom-field filters and sorting in PostgreSQL

Push the boolean and date custom-field predicates and custom-field
sorting down to JSONB expressions so the overview stops classifying
custom-field values in memory. A GIN index on custom_field_values.value
keeps the boolean membership predicates index-served.
This commit is contained in:
Simon 2026-07-03 11:19:59 +02:00
parent e64f55c36a
commit b09cdf7f3a
9 changed files with 883 additions and 5 deletions

View file

@ -0,0 +1,21 @@
defmodule Mv.Repo.Migrations.AddCustomFieldValuesValueGinIndex do
@moduledoc """
Adds a GIN index on `custom_field_values.value` (JSONB) to serve the boolean
custom-field containment predicates used by the member overview.
"""
use Ecto.Migration
def up do
create index(:custom_field_values, ["value"],
name: "custom_field_values_value_gin_index",
using: "gin"
)
end
def down do
drop_if_exists index(:custom_field_values, ["value"],
name: "custom_field_values_value_gin_index"
)
end
end