This table is creating temporary tables.. is there a better way to execute this..
Here is the table structures.
Any help would be great.
Andrew
Code:
(
SELECT u.id, p.function, u.hotspot, u.psid, u.ord
FROM userHotSpots u, prodSpots p
WHERE u.tid = '68'
AND u.type = 'product'
AND u.psid = p.id
)
UNION ALL (
SELECT u.id, '', u.hotspot, u.psid, u.ord
FROM userHotSpots u, userCustomSpots c
WHERE u.tid = '68'
AND u.type = 'custom'
AND u.psid = c.id
)
ORDER BY ord
Here is the table structures.
Code:
prodSpots
Field Type Null Default
id int(20) No
pid int(20) No 0
name varchar(255) No
function varchar(255) No
Indexes: Keyname Type Cardinality Field
PRIMARY PRIMARY 8 id
--------------------------------------------------------------------------------
userCustomSpots
Field Type Null Default
id int(20) No
tid int(20) No 0
name varchar(255) No
content longtext No
Indexes: Keyname Type Cardinality Field
PRIMARY PRIMARY 5 id
--------------------------------------------------------------------------------
userHotSpots
Field Type Null Default
id int(20) No
tid int(20) No 0
psid int(20) No 0
hotspot enum('none', 'underLogo', 'rightLogo', 'top', 'left', 'right') No none
type enum('product', 'custom') No product
ord int(20) No 0
Indexes: Keyname Type Cardinality Field
PRIMARY PRIMARY 253 id
sid INDEX 42 tid
tid INDEX 253 tid,type,psid
Any help would be great.
Andrew