Hello
the following sql is used in a forum (open source xmbforum.com) to determine if members of a forum are online and if they are, display them as online when people are viewing posts within a forum topic/thread.
As this sql is the most used on the forum (most people view topics rather than post topics)... I thought maybe variations on this sql could potentially also result in quicker execution time, so any ways of getting the same result set with variations on the sql below would be appreciated.
posts table - approx 100 000 rows
members table - approx 64 000 rows
whosonline - approx 130 rows
SELECT p., m.,w.time FROM $table_posts p LEFT JOIN $table_members m ON m.username=p.author LEFT JOIN $table_whosonline w ON p.author=w.username WHERE p.fid='$fid' AND p.tid='$tid' ORDER BY p.pid ASC