event db query tweaks