ALTER TABLE qna_table ADD COLUMN IF NOT EXISTS priority INT;
CREATE INDEX IF NOT EXISTS ix_qna_task_priority_desc_id_state_deleted_rater_ds_manager ON qna_table (task_id, priority DESC, id , state_id, deleted, last_assigned_rater, last_answered_ds, last_assigned_manager);