Added event filtering via SQL