Optimized some popular queries

If pool or datacenter in and query, time would be reduced. simple pool query reduced from 40 sec to 2 sec.

Also adding file logging to track how people using the query