Skip to content

Commit

Permalink
fix: use pg_trgm extension for indexing msg data->@type
Browse files Browse the repository at this point in the history
  • Loading branch information
blushi committed Nov 9, 2023
1 parent 1505243 commit f47676f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions migrations/schema_snapshot.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed';


--
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;


--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';


--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--
Expand Down Expand Up @@ -579,10 +593,10 @@ CREATE INDEX flyway_schema_history_s_idx ON public.flyway_schema_history USING b


--
-- Name: msg_data_type_idx; Type: INDEX; Schema: public; Owner: -
-- Name: msg_data_type_gin_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX msg_data_type_idx ON public.msg USING btree (((data -> '@type'::text)));
CREATE INDEX msg_data_type_gin_idx ON public.msg USING gin (((data ->> '@type'::text)) public.gin_trgm_ops);


--
Expand Down

0 comments on commit f47676f

Please sign in to comment.