-- Search performance support indexes for filtered DOC fulltext lookups.

CREATE INDEX IF NOT EXISTS idx_doc_document_type_family_updated
    ON DOC.doc_document(document_type, document_family, updated_at DESC, id);

CREATE INDEX IF NOT EXISTS idx_doc_document_type_family_visibility_updated
    ON DOC.doc_document(document_type, document_family, visibility, updated_at DESC, id);

CREATE INDEX IF NOT EXISTS idx_doc_text_repr_document_primary_type
    ON DOC.doc_text_representation(document_id, is_primary, representation_type);
