Skip to content

Commit

Permalink
Update markers index
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Dec 25, 2023
1 parent 4aadbdd commit 35dab40
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
6 changes: 6 additions & 0 deletions tools/database/49_update_markers_index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE INDEX idx_marker_item_source_class_point ON public.markers USING gist (item, source_id, class, point((lon)::double precision, (lat)::double precision));
CREATE INDEX idx_marker_point_item_2 ON public.markers USING gist (item, point((lon)::double precision, (lat)::double precision));
CREATE INDEX idx_marker_point_item_4 ON public.markers USING gist (point((lon)::double precision, (lat)::double precision));
CREATE INDEX idx_marker_source_class_box_point_2 ON public.markers USING gist (source_id, class, point((lon)::double precision, (lat)::double precision));
DROP INDEX IF EXISTS idx_marker_item;
DROP INDEX IF EXISTS idx_marker_item_lat_lon;
22 changes: 18 additions & 4 deletions tools/database/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -391,17 +391,24 @@ CREATE INDEX idx_marker_id ON public.markers USING btree (public.uuid_to_bigint(


--
-- Name: idx_marker_item; Type: INDEX; Schema: public; Owner: -
-- Name: idx_marker_item_point; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_marker_item ON public.markers USING btree (item);
CREATE INDEX idx_marker_item_point ON public.markers USING gist (item, point((lon)::double precision, (lat)::double precision));


--
-- Name: idx_marker_item_lat_lon; Type: INDEX; Schema: public; Owner: -
-- Name: idx_marker_item_source_class_point; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_marker_item_lat_lon ON public.markers USING btree (item, lat, lon);
CREATE INDEX idx_marker_item_source_class_point ON public.markers USING gist (item, source_id, class, point((lon)::double precision, (lat)::double precision));


--
-- Name: idx_marker_point; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_marker_point ON public.markers USING gist (point((lon)::double precision, (lat)::double precision));


--
Expand All @@ -411,6 +418,13 @@ CREATE INDEX idx_marker_item_lat_lon ON public.markers USING btree (item, lat, l
CREATE INDEX idx_marker_source_class ON public.markers USING btree (source_id, class);


--
-- Name: idx_marker_source_class_point; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX idx_marker_source_class_point ON public.markers USING gist (source_id, class, point((lon)::double precision, (lat)::double precision));


--
-- Name: idx_marker_usernames; Type: INDEX; Schema: public; Owner: -
--
Expand Down

0 comments on commit 35dab40

Please sign in to comment.