CREATE INDEX idx_appointment_appointment_date ON public.appointment USING btree
    ((appointment_date::date));


CREATE INDEX idx_appointment_appointment_date_appointment_status
    ON public.appointment USING btree
    (appointment_date ASC NULLS LAST, appointment_status ASC NULLS LAST)
    TABLESPACE pg_default;


CREATE INDEX idx_recording_id_room_appointment_study_receipt
    ON public.recording USING btree
    (id_room_appointment_study_receipt ASC NULLS LAST)
    TABLESPACE pg_default;

-- Index: idx_recording_id_user

-- DROP INDEX public.idx_recording_id_user;

CREATE INDEX idx_recording_id_user
    ON public.recording USING btree
    (id_user)
    TABLESPACE pg_default;
        
-- Index: idx_transcription_id_room_appointment_study_receipt

-- DROP INDEX public.idx_transcription_id_room_appointment_study_receipt;

CREATE INDEX idx_transcription_id_room_appointment_study_receipt
    ON public.transcription USING btree
    (id_room_appointment_study_receipt)
    TABLESPACE pg_default;


CREATE INDEX idx_devolution_historic_current ON public.devolution_historic USING btree
    (current);

CREATE INDEX idx_internal_order_codigo_cie10
    ON public.internal_order USING btree
    (codigo_cie10 ASC NULLS LAST)
    TABLESPACE pg_default;

CREATE INDEX idx_cie10_codigo_cie10
    ON public.cie_10 USING btree
    (codigo_cie_10 ASC NULLS LAST)
    TABLESPACE pg_default;




CREATE INDEX idx_room_appointment_study_receipt_id_rasr_appointment_code
    ON public.room_appointment_study_receipt USING btree
    (id_room_appointment_study_receipt ASC NULLS LAST, appointment_code ASC NULLS LAST)
    TABLESPACE pg_default;    