add LIMIT 50 to database polling SQL statements

This will stop the entire history log from the database being downloaded every minute or two.