I want to find new markets that have been added to a plan table after date 2012-05-17. This select works but performance is slow with 16k records. When I remove the second distinct keyword, performance improves greatly and I get the same results, but I still need this select to be much faster. It takes about 25 seconds. There must be a faster way?
select distinct(market)
from plan
where date_added > 2012-05-17
and market not in (select distinct(market) from plan where date_added < 2012-05-17 )