How about this option:

SELECT distinct ip_info.* FROM ip_info RIGHT JOIN network_events USING
(ip) RIGHT JOIN  host_events USING (ip) WHERE
(network_events.name='blah' OR host_events.name = 'blah')  AND
ip_info.ip IS NOT NULL;

Nah, that seems to be much much worse.  The other queries usually
return in 1-2 minutes, this one has been running for 30 minutes and
has still not returned

-Mike

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to