Hi,
I have this query :
It's painfully slow but it runs normally when I remove this part :
The question is : how do I speed up the query without throwing away the feature consisting in checking if a page has some content in it?
Thanks for the help!
I have this query :
Code:
SELECT
tab_nav.nav_zone_ID, tab_nav.nav_page_ID, tab_nav.nav_name,
tab_nav.nav_link_text_fr AS nav_link_text,
tab_nav.nav_link_tip_fr AS nav_link_tip, tab_nav.nav_link_pic,
tab_nav.nav_link_url_fr AS nav_link_url, tab_nav.nav_link_win,
tab_nav.nav_link_innercode_li, tab_nav.nav_link_innercode_ahref,
tab_nav.nav_option_ispage,
(SELECT IF(nav_name <> '','',tab_pages.page_path_fr)) AS page_path,
(
SELECT
CHAR_LENGTH(GROUP_CONCAT(content_text))
FROM
def_texts_content
WHERE
content_page_ID = tab_pages.page_ID
AND
content_lang LIKE 'fr'
) AS content_length
FROM
def_zones_nav AS tab_nav, def_pages AS tab_pages
WHERE
(tab_nav.nav_page_ID = tab_pages.page_ID
OR
tab_nav.nav_name NOT LIKE ''
)
AND
tab_nav.nav_zone_ID IN (37,12,15,16,29,31,1,7)
AND
tab_pages.lock_view NOT LIKE 'yes'
GROUP BY
tab_nav.nav_zone_ID, tab_nav.table_ID
ORDER BY
tab_nav.nav_zone_ID ASC, tab_nav.nav_link_order, nav_link_text
ASC
It's painfully slow but it runs normally when I remove this part :
Code:
(
SELECT
CHAR_LENGTH(GROUP_CONCAT(content_text))
FROM
def_texts_content
WHERE
content_page_ID = tab_pages.page_ID
AND
content_lang LIKE 'fr'
) AS content_length
The question is : how do I speed up the query without throwing away the feature consisting in checking if a page has some content in it?
Thanks for the help!