Was mag wohl schneller sein? Version 1:
SELECT element_id
FROM matches
JOIN objects ON object_id=element_id
WHERE parent_id IN($pids) AND inactive=0
ORDER BY create_date DESC
oder Version 2:
SELECT object_id
FROM objects
WHERE object_id IN
(
SELECT element_id
FROM matches
WHERE parent_id IN ($pids)
)
AND inactive=0
Funktionen für Ein kleine Lektion über Datenbank-Performance
- Markieren
- Sticky machen