Jack van Zanen wrote:
If I am not mistaken,
the second part of the union contains all rows that are in the first part of
the union. just remove the first part.
The first part is a join, the second isn't.
I was going to suggest rewriting the subquery into a single:
ip.blockid in (...)
bu.blockid in (...)
however that'll probably be slower, but def. worth a try.
Postgresql & php tutorials
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php