CREATE INDEX index_logs_on_device_id_and_created_at ON public.logs USING btree (device_id, created_at);

pull/935/head
Rick Carlino 2018-07-26 11:59:10 -05:00
parent d68516903a
commit c80d82aaa9
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,5 @@
class AddMoreMoreLogIndexes < ActiveRecord::Migration[5.2]
def change
add_index :logs, [:device_id, :created_at]
end
end

View File

@ -1827,6 +1827,13 @@ CREATE INDEX index_logs_on_created_at ON public.logs USING btree (created_at);
CREATE INDEX index_logs_on_device_id ON public.logs USING btree (device_id);
--
-- Name: index_logs_on_device_id_and_created_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_logs_on_device_id_and_created_at ON public.logs USING btree (device_id, created_at);
--
-- Name: index_logs_on_sent_at; Type: INDEX; Schema: public; Owner: -
--
@ -2287,6 +2294,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20180716163108'),
('20180719143412'),
('20180720021451'),
('20180726145505');
('20180726145505'),
('20180726165546');