一个查询用了40多秒,怎样来优化一下?
就是下面这个查询:select all lower(dm_document.object_name) lowerobjname, dm_document.r_object_id, dm_document.object_name, dm_document.r_object_type, dm_document.r_lock_owner, dm_document.owner_name, dm_document.r_link_cnt, dm_document.r_is_virtual_doc, dm_document.r_content_size, dm_document.a_content_type, dm_document.i_is_reference, dm_document.object_name, dm_repeating.r_version_label, dm_document.r_content_size, dm_document.r_modify_date from dm_document_sp dm_document, dm_document_rp dm_repeating where (lower(dm_document.object_name) like lower('%bmcc%') escape '\') and (dm_document.i_has_folder = 1 and dm_document.i_is_deleted = 0) and dm_repeating.r_object_id=dm_document.r_object_id order by 1 asc, dm_document.r_object_id asc for read only optimize for 20 rows
大家虽然不知道表结构,但是我觉得是索引有问题,对于表我已经运行了runstatistics任务,如果是索引的问题?请问我怎样快捷的来重建所有表的索引?如果不是索引的问题,可能是哪里的问题?
谢谢了!