hey guys
im running bellow query to fetch from 3 mysql tables and it works fine but it increases memory usage and sometime it takes 10 seconds to start loading the page
INNER JOIN table_tags AS ntg ON (ns.tags = '' OR CONCAT(' ',COALESCE(ns.tags,' '),' ') LIKE CONCAT('% ',ntg.tid,' %'))
INNER JOIN table_topics AS nto ON (ns.associated = '' OR CONCAT(' ',COALESCE(ns.associated,'-'),' ') LIKE CONCAT('%',nto.topicid,'%' ))
problem is in Inner Join statemnet and if i remove
ns.tags = '' OR
and
ns.associated = '' OR
the memory overuse problem will be fixed but cant show stories with empty tag field
is there any other way to write bellow statement to include all stories even those with no tags !?
INNER JOIN table_tags AS ntg ON (ns.tags = '' OR CONCAT(' ',COALESCE(ns.tags,' '),' ') LIKE CONCAT('% ',ntg.tid,' %'))
my tags id are stored in table_ns like ( 14 17 2 ) seprated with space