explain analyze select count(distinct a.subsno ) from subsexpired a where a.subsno not in (select b.subsno from subs b where b.subsno>75043 and b.subsno<=112565) and a.subsno>75043 and a.subsno<=112565;
Give you more information about real excecuting time.
explain select count(distinct a.subsno ) from subsexpired a where a.subsno not in (select b.subsno from subs b where b.subsno>75043 and b.subsno<=112565) and a.subsno>75043 and a.subsno<=112565;