Update base.py

EXISTS is cheaper than COUNT