presseportale/dev/legacy_performance/live-indexes.sql

17 lines
729 B
SQL

-- Legacy performance hotfixes for businessportal24.com
-- Execute these statements on the live database once.
--
-- If an index with the same name already exists, skip the matching ALTER TABLE
-- statement. Older MySQL versions do not support ADD INDEX IF NOT EXISTS.
ALTER TABLE press_release
ADD INDEX pr_status_language_created_idx (status, language, created_at);
ALTER TABLE press_release
ADD INDEX pr_category_status_language_created_idx (category_id, status, language, created_at);
ALTER TABLE press_release
ADD INDEX pr_company_status_language_created_idx (company_id, status, language, created_at);
ALTER TABLE press_release_image
ADD INDEX pri_pressrelease_preview_idx (press_release_id, is_preview_image);