SELECT bb_code.*
FROM xf_bb_code AS bb_code
LEFT JOIN xf_addon AS addon ON (addon.addon_id = bb_code.addon_id)
WHERE (bb_code.active = 1) AND ((addon.active IS NULL OR addon.active = 1))
ORDER BY bb_code.bb_code_id

Run Time: 0.000549

Select Type

Table

Type

Possible Keys

Key

Key Len

Ref

Rows

Extra

SIMPLE

bb_code

index

PRIMARY

27

13

Using where

SIMPLE

addon

eq_ref

PRIMARY

PRIMARY

27

affdog_xforum.bb_code.addon_id

1

Using where

SELECT bb_code_media_site.*
FROM xf_bb_code_media_site AS bb_code_media_site
LEFT JOIN xf_addon AS addon ON (addon.addon_id = bb_code_media_site.addon_id)
WHERE 1=1
ORDER BY bb_code_media_site.site_title