how do you optimize this query?
SELECT SUBSTR(eventDetails, INSTR(eventDetails, '|#|Name') + 8, INSTR(eventDetails, '|#|StartDate') - INSTR(eventDetails, '|#|Name') - eventTitle, SUBSTR(eventDetails, INSTR(eventDetails, '|#|City') + 8, INSTR(eventDetails, '|#|State') - INSTR(eventDetails, '|#|City') - city, IF(UNIX_TIMESTAMP(SUBSTR(eventDetails, INSTR(eventDetails, '|#|StartDate') + 13, 10)) = 0, SUBSTR(eventDetails, INSTR(eventDetails, '|#|StartDate') + 13, 10), UNIX_TIMESTAMP(SUBSTR(eventDetails, INSTR(eventDetails, '|#|StartDate') + 13, 10))) eventStartDate, IF(UNIX_TIMESTAMP(SUBSTR(eventDetails, INSTR(eventDetails, '|#|EndDate') + 11, 10)) = 0, SUBSTR(eventDetails, INSTR(eventDetails, '|#|EndDate') + 11, 10), UNIX_TIMESTAMP(SUBSTR(eventDetails, INSTR(eventDetails, '|#|EndDate') + 11, 10))) eventEndDate, SUBSTR(eventDetails, INSTR(eventDetails, '|#|State') + 9, INSTR(eventDetails, '|#|Zip') - INSTR(eventDetails, '|#|State') - 9) eventState
FROM events
WHERE eventDetails NOT LIKE '%Canceled:YES%'
AND eventDetails NOT LIKE '%State:|#|%'
AND eventDetails NOT LIKE '%Status:DELETED%'
AND (eventDetails NOT LIKE '%PromoterPhone:|#|%' OR eventDetails NOT LIKE '%Link1:' OR eventDetails NOT LIKE '%UserNumber:0|#|%' OR eventDetails NOT LIKE '%UserNumber:|#|%')
AND SUBSTR(eventDetails, INSTR(eventDetails, '|#|State') + 9, INSTR(eventDetails, '|#|Zip') - INSTR(eventDetails, '|#|State') - 9) = 'RI'
HAVING ((eventStartDate BETWEEN '1261980000' AND '1282712400') AND (eventEndDate BETWEEN '1261980000' AND '1282712400'))
ORDER BY eventStartDate ASC LIMIT 0, 20;